什么在下面的代码是引起警告:非法字符串偏移量'在'因为PHP 5.4版本无法找到修复?警告:非法字符串偏移PHP的推车和mysql表
<?php
include "data.php";
function checkStock($id_film){
$query_stock = "SELECT stockquantity FROM table WHERE id = {$id_film}";
$result_stock = mysql_query($query_stock);
$row = mysql_fetch_row($result_stock);
echo $row[0]['quantity']; //this where the error is
}
我敢打赌,你只是想''行['数量'];' - 你试过'var_dump($ row);'看看里面究竟是什么? – rjdown
快速回复这是错误回声$ row [0] ['quantity'];和var_dump($ row);似乎摆脱了错误 – paul