hi there,
I\'m new and just coming down from the elation of getting mysql_connect to actually work.
I\'m having trouble with mysql_fetch_array and I can\'t see why. I have used the code below to link to the DB:
$db = mysql_select_db($database,$connection) or die (\"Couldn\'t select database.\");
$query = \"SELECT loginname FROM dantest\";
$result = mysql_query($query) or die(\"Couldn\'t execute query!\");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
echo $row[\'password\'];
The problem is that $row, when echoed, returns the word \'array\' and not the name that I expected. I want to compare the loginname to another variable butI have clearly done something daft!
Any help would be greatly appreciated!
Cheers
Dan