Re: [請益] Mysql Syntax Error
※ 引述《rpuppy (funny)》之銘言:
: Could not run query: You have an error in your SQL syntax; check the manual
: that corresponds to your MySQL server version for the right syntax to use
: near 'check='1'' at line 1
: 程式碼如下:
: $sql="select count(*) from $friend where check='1'";
$sql = sprintf("select count(*) from `%s` where `check` = '1'", $friend);
這樣寫 比較不會有錯誤 將來也會比較好維護
: $result=mysql_query($sql,$db);
: if(!$result) {
: echo 'Could not run query: ' . mysql_error();
: exit;
: }
: 請問是版本更新所造成的問題嗎? 懇請各位大大回答
: 謝謝各位!
--
********************************************************
* 瘋狂小惡魔分享討論區 *
* http://www.forum.Wu-Boy.com/index.php *
* 無名相簿-appleboy *
* http://www.wretch.cc/album/appleboy *
********************************************************
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.203.237.84
推
05/14 01:23, , 1F
05/14 01:23, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):