¹ØÓÚÖØÐÂapacheºóÎÞ·¨ÔØÈëmysqlÀ©Õ¹½â¾ö°ì·¨
ÍøÉϺܶàдÔÚwindowsÏÂÎÞ·¨ÔØÈëmysqlÀ©Õ¹½â¾ö°ì·¨£¬µ«ÊÇÔÚliunxϵľÍû¼¸¸ö£¬ÒÔÏÂÊÇÔÚliunxϵĽâ¾ö°ì·¨
֨װºóphp²»»á×Ô¶¯°Ñmysql.soÀ©Õ¹¼ÓÉÏÈ¥,Òª
sudo vim /etc/php5/apache2/conf.d/pdo.ini
¼ÓÈëextension=mysql.so¾Í¿ÉÒÔÁË
ÆäʵҲ¿ÉÒÔÔÚ /etc/php5/apache2/php.iniÖмÓÈë
Ò²¿ÉÒÔÔÚ/etc/php5/apache2/conf.d/Öжà¼ÓÒ»¸ömysql.iniÀïÃæ¼ÓÈëextension=mysql.so
Ïà¹ØÎĵµ£º
1¡¢PHP·¢ËÍÖÐÎÄ¡¢Ajax½ÓÊÕ
Ö»ÐèÔÚphp¶¥²¿¼ÓÈëÒ»¾ä£º
header('Content-type: text/html;charset=GB2312');
xmlHttp»áÕýÈ·½âÎöÆäÖеÄÖÐÎÄ¡£
2¡¢Ajax·¢ËÍÖÐÎÄ¡¢PHP½ÓÊÕ
Õâ¸ö±È½Ï¸´ÔÓ£º
AjaxÖÐÏÈÓÃencodeURIComponent¶ÔÒªÌá½»µÄÖÐÎĽøÐбàÂë
PHPÖУº
$GB2312string=iconv( ‘UTF-8′, ‘gb2312//I ......
select id from message where author_id in (select followed_id from Relation where follower_id=1) order by id desc ºÍ ·Ö±ðÖ´ÐÐ $userlist = select followed_id from Relation where follower_id=1 ÔÙ select id from message where author_id in ($userlist) order by id desc ¾¹È»ÓÐÁ½¸öÊýÁ ......
Ò»¡¢INSERTºÍREPLACE
INSERTºÍREPLACEÓï¾äµÄ¹¦Äܶ¼ÊÇÏò±íÖвåÈëеÄÊý¾Ý¡£ÕâÁ½ÌõÓï¾äµÄÓï·¨ÀàËÆ¡£ËüÃǵÄÖ÷񻂿±ðÊÇÈçºÎ´¦ÀíÖØ¸´µÄÊý¾Ý¡£
1. INSERTµÄÒ»°ãÓ÷¨
MySQLÖеÄINSERTÓï¾äºÍ±ê×¼µÄINSERT²»Ì«Ò»Ñù£¬ÔÚ±ê×¼µÄSQLÓï¾äÖУ¬Ò»´Î²åÈëÒ»Ìõ¼Ç¼µÄINSERTÓï¾äÖ»ÓÐÒ»ÖÖÐÎʽ¡£
INSERT INTO tablename(ÁÐÃû…) ......
Mysql Öж¨Òå×ֶκóµÄÊý¾ÝµÄÓô¦£º
int(1)ºÍint(10)ËÆºõûÓÐʲô²î±ð£¬¶¼±íʾ×î´óËĸö×Ö½ÚµÄÕûÐÍÊý¾Ý¡£
ÀýÈ綨ÒåÒ»¸öÃû×ÖΪtestµÄ±í:
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
`id` int(1) NOT NULL,
`ids` int(10) default NULL,
`c` char(1) default NULL,
`cs` ......