mysql updateÓï¾ä Çë½Ì¸÷λ¸ç¸ç - PHP / »ù´¡±à³Ì
Çë½Ì: ´Ó±íÖÐÈ¡³öij×Ö¶ÎÐÅÏ¢£¬ÔÚÔÐÅÏ¢ÖÐÌí¼ÓÈô¸ÉÄÚÈÝ£¬ÔÙдÈëÔ×ֶΡ£
·Ö³ÉÁ½²½¾ÍÊÇ£º
//È¡³ö
$result = mysql_query ( select 'infor' from 'table' where 'id' = 99 );
$result = $result['infor'] + "ÐèÒªÌí¼ÓµÄÄÚÈÝ" £»
//¸üÐÂ
update `table` set `infor`= `infor`+ $result where 'id' = 99 ;
ÓÃÒ»ÌõÓï¾äÖ´ÐУ¬Ó¦¸ÃÔõôд£¿
update `table` set `infor`= concat(infor,"ÐèÒªÌí¼ÓµÄÄÚÈÝ") where id= 99 ;
update `table` set `infor`= concat(infor,"ÐèÒªÌí¼ÓµÄÄÚÈÝ") where id= 99 ;
µ«info²»ÄÜΪnull, ·ñÔò»á×ÜÊÇnull
½øÀ´Ñ§Ï°Ò»Ï¡£
ѧϰ£»¶î
¿ÉÒÔÊÔÊÔÈýÔªÔËËã·û£¬ÔÚphpÀïдÈýÔªÔËËã·ûÄãÔÝʱ°ïËûµ±³ÉphpÀ´Ð´ ²»»áÓ°Ïì˼·
¾ßÌåÓ﷨¥Ö÷¿ÉÒÔ²éÊֲᣬ
PHP code:
//·½·¨Ò»
//´ó¸ÅÊÇÕâ¾ä£¬Ê״βåÈ룬µÚ¶þ´ÎÊǸüÐÂ
insert into story (id,infor) values(99,'ÐèÒªÌí¼ÓµÄÄÚÈÝ') on duplicate key update set infor = concat(infor,'ÐèÒªÌí¼ÓµÄÄÚÈÝ') ;
//·½·¨¶þ
update `table` set `infor`= concat(infor,"ÐèÒªÌí¼ÓµÄÄÚÈÝ") where id= 99 ;
SQL code:
mysql> select * from tb1;
+----+------+
| id | str |
+----+------+
| 1 | abc |
+----+------+
1 row in set (0.00 sec)
mysql&
Ïà¹ØÎÊ´ð£º
Ôڲɼ¯Ò»¸öÒ³ÃæµÄʱºòͨ³£¶¼ÊÇʹÓÃfile_get_contents($url)
²»¹ý·µ»ØµÄ½á¹ûÓÐʱºò»á²»È«
Èç¹ûÔÚhtmlÖÐʹÓà document.ready,ÔÚÒ³Ãæ×¼±¸ºÃºó£¬Ê¹ÓÃajax¶ÁÈ¡±ðÒ»²¿·ÖµÄÊý¾Ý
ÔÙͨ¹ýÐÞ¸Ähtml±êÇ©µÄÄÚÈÝ£¬¾Í²¿·ÖµÄÊý¾Ý¾ ......
index.phpÄÚÈÝ£º
$smarty->assign('name',strtotime('-0'));
$smarty->display("index.html");
index.htmlÄÚÈÝ£º
{$name|date_format:'%Y-%m-%d'}<hr>
{$ ......
×î½üÒ»¸öÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣺ÔÚÔÓеÄÒ»Ì×ϵͳÖÐ(php¿ª·¢)Ìí¼ÓһЩС¹¦ÄÜ(jsp¿ª·¢)£¬ÔÀ´Óû§ÏµÍ³¶¼ÊÇphp¿ª·¢µÄ£¬ÎÒÈçºÎÔÚjsp¿ª·¢µÄ¹¦ÄÜÖÐ×öµ½Óû§ÐÅÏ¢sessionͬ²½ÄØ£¿ ÓÐÈËÊÇ·ñÓÐ×ö¹ýÀàÒÔÏîÄ¿£¬ÏëÌýÌý´ó¼ÒµÄ¿´·¨
......
mssql_select_db("f1",mssql_connect("localhost","sa","sa"));
mssql_select_db("f2",mssql_connect("192.168.0.1","sa","sa") ......
ÈçÌ⣬Ôõôд¸öheadÍ·²¿ ÈÃÒ³Ãæ»º´æ1ÐÇÆÚ¡£
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Äã°ÑÀïÃæµÄʱ¼ä£¬¸Ä³Éµ±Ç°Ê±¼ä¼ÓÉÏÒ»¸öÐÇÆÚ
¼ÇµÃҪת»»³Égmtʱ¼ä
ÎÒÕâÑùдµÄ ²»ÖªµÀÐв»ÐС£
Ò»¸öÐ ......