我收到这些错误:
Warning: Illegal string offset 'approved' in C:... on line 137
Warning: Illegal string offset 'approved' in C:... on line 147
但是,我用 print_r() 检查我可以调用哪些值并得到这个:
Array (
[0] => 3
[id] => 3
[1] => 3
[user_fk] => 3
[2] => > Jailbot 2.0
[title] => > Jailbot 2.0
[3] => 1
[approved] => 1
)
那为什么不让我打电话批准?
PHP:
$avatarQuery = "SELECT * FROM avatars WHERE user_fk = {$id} LIMIT 1";
$avatarSet = mysql_query($avatarQuery, $connection);
confirm_query($avatarSet);
$count = mysql_num_rows($avatarSet);
if($count == 1){
$avatar = mysql_fetch_array($avatarSet);
$avatar = $avatar['picture'];
$avatarApproved = $avatar['approved'];
}else{
$avatar = "images/noImage.png";
}
$titleQuery = "SELECT * FROM titles WHERE user_fk = {$id} LIMIT 1";
$titleSet = mysql_query($titleQuery, $connection);
confirm_query($titleSet);
$title = mysql_fetch_array($titleSet);
$title = $title['title'];
$titleApproved = $title['approved'];