请问这段代码为什么总是显示You have an error in your SQL syntax....at line 1
来源:百度知道 编辑:UC知道 时间:2024/05/03 04:31:58
问题显示
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 '' at line 1
这是问题所在网址
http://www.0731tz.com/fang_xian.php?id=1877&room=售
<?
//$query="select id,substring_index(anming,'\n',1),commend,saleprice,posttime,room,build_area
from fang where commend='是' and room='售' order by posttime desc limit 12";
//$res=mysql_db_query("u735494",$query);
//while($row=mysql_fetch_array($res))
//{
$query="select id,left(anming,16),commend,saleprice,posttime,room,build_area from fang where
commend='是' and room='售' order by posttime desc limit 12";
$result=mysql_query($query,$link_ID) or die(mysql_error());
while($row=mysql_fetc
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 '' at line 1
这是问题所在网址
http://www.0731tz.com/fang_xian.php?id=1877&room=售
<?
//$query="select id,substring_index(anming,'\n',1),commend,saleprice,posttime,room,build_area
from fang where commend='是' and room='售' order by posttime desc limit 12";
//$res=mysql_db_query("u735494",$query);
//while($row=mysql_fetch_array($res))
//{
$query="select id,left(anming,16),commend,saleprice,posttime,room,build_area from fang where
commend='是' and room='售' order by posttime desc limit 12";
$result=mysql_query($query,$link_ID) or die(mysql_error());
while($row=mysql_fetc
您有一个错误在您的SQL 句法。
检查对应于您的MySQL 服务器版本为正确的句法于用于此版本。
看来你是升级数据库的版本了。
升级前,如果备份了,那么返回以前,重新导一下你的数据库,然后配置服务器新版,导入,问题解决。
应该是你的语句错了 。
//{
$query="select id,left(anming,16),commend,saleprice,posttime,room,build_area from fang where commend='是' and room='售' order by posttime desc limit 12";
$result=mysql_query($query,$link_ID) or die(mysql_error());
while($row=mysql_fetch_row($result))
{
?>