Php 警告:非法字符串偏移量';curu#u name';
我收到错误“警告:非法字符串偏移量'cur_name'”。我只是在学习php,不知道如何修复此错误,如有任何帮助,将不胜感激Php 警告:非法字符串偏移量';curu#u name';,php,Php,我收到错误“警告:非法字符串偏移量'cur_name'”。我只是在学习php,不知道如何修复此错误,如有任何帮助,将不胜感激 $amount=mysql_fetch_array(mysql_query("select sum(amount) from transactions where adv_id=".$rs_query["id"]." group by adv_id")); if($amount) { echo $c
$amount=mysql_fetch_array(mysql_query("select sum(amount) from transactions where adv_id=".$rs_query["id"]." group by adv_id"));
if($amount)
{
echo $cur["cur_name"].$amount[0];
?>
试着这样做:
if($amount)
echo $amount[0];
但您最好不要使用不推荐使用的PDO
mysql\u fetch\u array
,并在internet上阅读更多内容:-)您在哪里声明$cur
?另外,您没有关闭if分支。和:mysql_*函数已弃用。请参阅上的警告。例如,请参阅本页右下部分的任何其他“相关问题”。