Php 在zen cart中执行jquery ajax post时出现500个内部服务器错误

Php 在zen cart中执行jquery ajax post时出现500个内部服务器错误,php,jquery,ajax,zen-cart,Php,Jquery,Ajax,Zen Cart,您好,我正在使用zen cart并有此代码,我不断收到500个内部服务器错误,我不确定这是我的php脚本中的代码还是什么,这里的两个代码都是: <?php global $db $partNum = trim(strtolower($_POST['partNum'])); $partNum = mysql_escape_string($partNum); $query = "SELECT products_model FROM " . TABLE_PRODUCTS . " WHERE

您好,我正在使用zen cart并有此代码,我不断收到500个内部服务器错误,我不确定这是我的php脚本中的代码还是什么,这里的两个代码都是:

<?php
global $db

$partNum = trim(strtolower($_POST['partNum']));
$partNum = mysql_escape_string($partNum);

$query = "SELECT products_model FROM " . TABLE_PRODUCTS . " WHERE products_model = '$partNum' LIMIT 1";
$result = $db->Execute($query);
$num = mysql_num_rows($result);

echo $num;
mysql_close();
这里是错误

POST http://mysite.com/includes/templates/theme376/phpScripts/check.php?partNum=wwww 500 (Internal Server Error) /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
f.support.ajax.f.ajaxTransport.send /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
f.extend.ajax /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
partNum_check index.php:307
f.event.dispatch /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:37
f.event.add.h.handle.i

从数据中取出partnum并将其用作查询字符串

你只是得到一个普通的500错误?没有细节

如果在请求URL中放入?partnum=blah,会发生什么


我不确定您是否希望在这样的数据中使用查询参数。这意味着数据,而不是查询字符串。

500错误意味着服务器端错误,因此错误很可能出现在PHP中。找到它,这是我刚刚连接到数据库时的一个错误?partnum=blah仍然在更新帖子时收到500错误
POST http://mysite.com/includes/templates/theme376/phpScripts/check.php?partNum=wwww 500 (Internal Server Error) /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
f.support.ajax.f.ajaxTransport.send /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
f.extend.ajax /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
partNum_check index.php:307
f.event.dispatch /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:37
f.event.add.h.handle.i