I thought I could find loads of examples on how to do this but nothing I find tells me how to get the values in PHP.
Say I have this code:
$query = "SELECT name, age FROM people WHERE id = 2";
$result = mysql_query($query);
How do I get the data from $result?
Pseudo code:
$name = $result['name'];
$age = $result['age'];
Did you try this?
$query = "SELECT name, age FROM people WHERE id = 2";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
echo $row['name'];
echo $row['age'];
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments