我做的代碼,試圖在我的論壇上用戶活動的手冊,當我在這行添加您的SQL語法有錯誤;檢查對應於你的MySQL服務器
$cat_id = $db->fetch("SELECT name FROM " . $prefix . "_categories WHERE id =" . mysql_real_escape_string($forum_data['cat_id']));
$page_title_pro = ' > ' . $system->present($cat_id['name']) . ' > ' . $system->present($forum_data['name']) . '';
我得到
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 's Treasures > Contests' WHERE id = '2'' at line 1
我假設2是我的用戶ID和頁腳,我有這樣的:
$db->query("UPDATE accounts SET flocation = '$session_location', page = '$page_title_pro' WHERE id = '$id';");
我似乎無法找出錯誤,和每一個恢復到正常的時候我走了CAT_ID,BU那麼我不能使用當前活動的配置文件。有什麼建議麼?
什麼是'$ prefix'內容? – 2013-03-16 03:17:55
您正在檢索的值有一個'in'。你的SQL語法有錯誤;檢查與您的MySQL服務器版本對應的手冊,以便在第1行使用** near'Treasures **> Contests'WHERE id ='2''。這是'name'的數據,它將它搞亂。 – 2013-03-16 03:19:12
$前綴是表前綴,這是論壇@MarioWenig:我找不到我的代碼的任何行這是頁腳代碼,但我該如何改變它? – Malik 2013-03-16 03:20:25