PHP¿ò¼ÜCodeIgniterµÄÊý¾Ý¿â²Ù×÷ÕûÀí
1.
$query = $this->db->query('SELECT name, title, email from my_table');
foreach ($query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->email;
}
2.
foreach ($query->result_array() as $row)
{
echo $row['title'];
echo $row['name'];
echo $row['email'];
}
3.
if ($query->num_rows() > 0)
4.
$query = $this->db->query('SELECT name from my_table LIMIT 1');
$row = $query->row();//$row = $query->row_array();
echo $row->name;
Äã¿ÉÒÔ´«µÝ²ÎÊýÒÔ±ã»ñµÃijһÐеÄÊý¾Ý¡£±ÈÈçÎÒÃÇÒª»ñµÃµÚ 5 ÐеÄÊý¾Ý£º
$row = $query->row_array(5);
³ý´ËÒÔÍâ, ÎÒÃÇ»¹¿ÉÒÔʹÓÃÏÂÃæµÄ·½·¨Í¨¹ýÓαêµÄ·½Ê½»ñÈ¡¼Ç¼£º
$row = $query->first_row()
$row = $query->last_row()
$row = $query->next_row()
$row = $query->previous_row()
5.
$sql = "INSERT INTO mytable (title, name)
VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")";
$this->db->query($sql);//$query = $this->db->get('table_name');
echo $this->db->affected_rows();
6.
$data = array(
'title' => $title,
'name' => $name,
'date' => $date
);
$this->db->insert('mytable', $data);
// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
7.
$this->db->escape()
8.
$sql = "SELECT * from some_table WHERE id = ? AND status = ? AND author = ?";
$this->db->query($sql, array(3, 'live', 'Rick')); //×Ô¶¯×ªÒå
9.
¸Ãº¯Êý·µ»Øµ±Ç°ÇëÇóµÄ×Ö¶ÎÊý£¨ÁÐÊý£©£º
$query = $this->db->query(
Ïà¹ØÎĵµ£º
ÅúÁ¿È¥³ýBOMµÄ³ÌÐò
function
replace_utf8bom(
$str
)
{
$charset
[1] =
substr
(
$str
,0,1);
$charset
[2] =
substr
(
$str
,1,1);
$ch ......
ÕâÖÖÎÊÌâÎÒÏë´ó¼Ò¿ÉÄܶ¼Óöµ½¹ý£¬ÍøÓÑÌṩµÄ½â¾ö·½·¨Ò²ºÜ¶à¡£ÎÒÒ²Ö»ÊǽáºÏ×Ô¼ºÏµÍ³µÄÐèÇó²¢½áºÏÍøÓѵĽâ¾ö·½°¸À´×ܽáµÄÒ»ÖÖ·½·¨
ÓÃÀ´×÷Ϊ½â¾öphpÒÔrootȨÏÞÖ´ÐÐһЩÆÕͨÓû§²»ÄÜÖ´ÐеÄÃüÁî»òÓ¦ÓõIJο¼¡£
ÆäʵphpÀïµÄpopen()º¯ÊýÊÇ¿ÉÒÔ½â¾öÕâ¸öÎÊÌâµÄ£¬µ«ÊÇÓÉÓÚijЩ°æ±¾µÄlinux(ÈçÎÒʹÓõÄCentos 5)¶Ôϵͳ°²È«µÄ¿¼ÂÇ£¬
ʹ ......
×¼±¸ÖªÊ¶£º
Ubuntu :
Ubuntu ÊÇlinuxµÄÒ»¸ö°æ±¾£¬ÓзÇÖÞ·¢²¼µÄ£¬ÏÖÔڱȽÏÁ÷ÐеÄÒ»¸ö°æ±¾¡£
²Î¿¼°Ù¶È˵Ã÷Ubuntu
nginx ¡¡£º
Nginx ("engine x") ÊÇÒ»¸ö¸ßÐÔÄÜµÄ HTTP ºÍ ·´Ïò´úÀí ·þÎñÆ÷£¬Ò²ÊÇÒ»¸ö IMAP/POP3/SMTP ´úÀí·þÎñÆ÷¡£ Nginx ÊÇÓÉ Igor Sysoev Ϊ¶íÂÞ˹·ÃÎÊÁ¿µÚ¶þµÄ Rambler.ru Õ¾µã¿ ......
×÷Õߣºhttp://blog.csdn.net/zhoufoxcn/archive/2009/11/05/4769858.aspx
˵Ã÷£ºÒòΪ×î½ü¹¤×÷¹¤×÷¹ØÏµ£¬ÐèÒª¿ª·¢Ò»¸öÔÚLinuxÏÂÔËÐеÄWeb
Application£¬ÐèÒª¶ÔÏÖÔڱȽÏÁ÷ÐеÄһЩPHP¿ò¼Ü×öÒ»¸öÁ˽âºÍÆÀ¹À£¬ÏÂÃæµÄÕâÆªÎÄÕÂÊDZÊÕß×î½üѧϰһ¸ö±È½ÏеÄPHP
FrameworkµÄÒ»µã¾ÀúºÍ²Ù×÷²½Ö裬ÒòΪ¹Ù·½µÄÊÖ²áдµÃ±È½Ï»Þ ......
PHP³ÌÐòÔ±×îÒ×·¸10ÖÖ´íÎó(ת)
php 2008-07-11 23:45 ÔĶÁ5 ÆÀÂÛ0
×ֺţº ´ó´ó ÖÐÖРСС
PHPÊǸöΰ´óµÄweb¿ª·¢ÓïÑÔ£¬Áé»îµÄÓïÑÔ£¬µ«ÊÇ¿´µ½php³ÌÐòÔ±Öܶø¸´Ê¼µÄ·¸µÄһЩ´íÎó¡£ÎÒ×öÁËÏÂÃæÕâ¸öÁÐ±í£¬ÁгöÁËPHP³ÌÐòÔ±¾³£·¸µÄ10ÖдíÎ󣬴ó¶àÊýºÍ°²È«Ïà¹Ø¡£¿´ ......