可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
sorry for being vague but I have a PHP script which extracts data from a database and displays it, however instead of outputting the contents of the database it outputs 'Array' the number of times their are results.
(Couldn't get the to work again, script uploaded here), the script's output is also here.) Thanks :-)
回答1:
$row
is an array, in contains all record fields. Use
echo $rows['unique_id'];
instead.
And don't use mysql extension
回答2:
Use print_r($array);
or var_dump($array);
to see
回答3:
Have you tried printr
or var_dump
?
You need to specify the column or value in the array to echo
.
echo $rows[unique_id];
回答4:
As the name implies, mysql_fetch_array()
returns an array. You probably want:
echo $rows['unique_id'];