I would like to assign my database values in an array format. For example, if my query will return three values, I would like the following:
$fname[1], $fname[2] and $fname[3]
How can this be done?
Below is the code I am starting with:
$query = "SELECT * people WHERE address=$address";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['fname'];
}
However, I need to be able to select a specific $fname (first, second or third value).
Thank you for your help in advance.