I have a mysql table with member data. I need to query that data for a particular member's data and then display it on the page.
$g = "select * from members where id = 2";
$grec = mysql_db_query($dbname, $g) or die(mysql_error());
while ($r = mysql_fetch_row($grec)){
echo "<p>".fieldname."<br>".fielddata."</p>";
}
This particular customer changes things quite often and he may add more fields in the future. Therefore, if I use mysql_fetch_array and put in all the fieldnames, it won't catch the new ones that the customer ads.
Can mysql_fetch_row be used to loop through the data and show the fieldname and corresponding data?
If so, what is the code to do so?