gpt4 book ai didi

php - mysql:连接正常但响应错误

转载 作者:行者123 更新时间:2023-11-29 09:18:31 25 4
gpt4 key购买 nike

这是我的代码:

    $Line = mysql_real_escape_string(postVar("showline"));
$Model = mysql_real_escape_string(postVar("showmodel"));
$NIK = mysql_real_escape_string(postVar("showNIK"));

$sql ="SELECT NIK,Line,Model FROM inspection_report";
$sql.="WHERE NIK='".$NIK."' AND Model LIKE '%".$Model."%' AND Line='".$Line."'";
$sql.="ORDER BY Inspection_datetime DESC LIMIT 0 , 30";

$dbc=mysql_connect(_SRV, _ACCID, _PWD) or die(_ERROR15.": ".mysql_error());
mysql_select_db("qdbase") or die(_ERROR17.": ".mysql_error());
$res=mysql_query($sql) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() ); // submit SQL to MySQL and error trap.
$num=mysql_affected_rows();
$objJSON=new mysql2json();
print(trim($objJSON->getJSON($res,$num,'aaData',false)));

mysql_free_result($res);

在 firebugs 中显示与进程页面的连接正常...但在响应中显示错误..我的错在哪里?

最佳答案

我假设是 PHP。

在上面的行后面添加命令 echo $sql;。我敢打赌您的查询格式错误,即 FROM 子句末尾和 WHERE 之间没有空格。与 ORDER BY 相同。一直在发生;)

关于php - mysql:连接正常但响应错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3137434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com