作者:
coechp (Peter)
2017-12-16 17:56:08phpmyadmin可執行下列SQL查詢
update history set comment=concat(comment,'<a href="detail" target="_blank">
查詢流程</a>') WHERE `status_id`=1 and comment LIKE '%結果 : Succeeded.%'
and `date_added`>= curdate()
但相同語法置於.php執行會出現錯誤
<?php
$username="username";
$password="password";
$dbname="database";
$dbhost="localhost";
$query="update history set comment=concat(comment,'<a href="detail" target
="_blank">查詢流程</a>') WHERE `status_id`=1 and comment LIKE '%結果 :
Succeeded.%' and `date_added`>= curdate()";
mysql_connect($dbhost,$username,$password);
@mysql_select_db($dbname) or die(strftime('%c')." Unable to select database");
mysql_query($query);
mysql_close();
echo strftime('%c')." ok!";
?>
還請各位版大指教~感謝!