Well, I know there is a funciton mysql_fetch_array() and we can use it like this:
while ($row = mysql_fetch_array($result)) {
echo $row['name'] . "<br />";
}
But is there any other way? For example, if there is only one element that can be returned, and not an array.
Thanks)
If there’s only going to be one row then you can just say:
Or you can use mysql_fetch_row if you want.
But I’d second Erik’s comment to go with PDO. Here’s a good tutorial making heavy use of PDO.