I wrote a simple PHP to retrieve data from MySql. It only work when I echo it out in row no but not the field name of the table. Why?
(e.g) echo $row[1] ---> worked but echo $row["fieldname"] ---> not working !
Could anyone help ? Thanks a lot.
Try using a different [man]MySQL[/man] function to fetch the row.
show yours code,pls.
I change mysql_fetch_row to array or assoc, and it works. Thank you. But what are their difference ? and when to use which ?
Try reading the manual for [man]mysql_fetch_assoc[/man] and [man]mysql_fetch_array[/man] ?
mysql_fetch_assoc -- Fetch a result row as an associative array
mysql_fetch_array -- Fetch a result row as an associative array, a numeric array, or both