SELECT query returning ARRAY instead of database values
Posted: Sun Feb 01, 2004 5:29 am
hi this is not coplicated code at all and i don't understand why it is not workin i am just creating a php front end reader of the info in my data base and i get no erroers but i don't get any real data from the database either just the word array
<?
$dbcon = mysql_pconnect("xxxxxxx", "xxxxxx", "xxxxx") or die(mysql_error());
mysql_select_db("suggestions", $dbcon) or die(mysql_error());
$query = "SELECT firstname,suggestion,lastname FROM suggestions "or die(mysql_error());
$result = mysql_query($query) or die(mysql_error());
$num_results = mysql_num_rows($result) or die(mysql_error());
for($i = 0; $i < $num_results; $i++){
$row = mysql_fetch_row($result) or die(mysql_error());
echo "Suggestion #". $i;
echo ($row);
}
?>
help please this is my first real complete application in php/mysql and believe me the data exists in a database called suggestions
<?
$dbcon = mysql_pconnect("xxxxxxx", "xxxxxx", "xxxxx") or die(mysql_error());
mysql_select_db("suggestions", $dbcon) or die(mysql_error());
$query = "SELECT firstname,suggestion,lastname FROM suggestions "or die(mysql_error());
$result = mysql_query($query) or die(mysql_error());
$num_results = mysql_num_rows($result) or die(mysql_error());
for($i = 0; $i < $num_results; $i++){
$row = mysql_fetch_row($result) or die(mysql_error());
echo "Suggestion #". $i;
echo ($row);
}
?>
help please this is my first real complete application in php/mysql and believe me the data exists in a database called suggestions