I have a DB set up with tables with 'name' and 'total'. 'total' is an auto_increment primary key. $location is a var of the name of the table to retrieve from. Here's my code to retrieve it:
Code: Select all
<?php
$getID = 'SELECT total FROM '.$location;
$getID_q = mysql_query($getID, $db);
while($row = mysql_fetch_assoc($getID_q)){
echo $row['total'];
}I checked the mySQL manual but to no avail.