我编写了代码来尝试我的论坛上的用户活动,当我添加这一行时
$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 时,一切都恢复正常,但是我无法将当前活动用于配置文件。有什么建议么?