I'm trying to pull a set of numbers out of a database. The SQL statement works great in MySQL, I get all the numbers in the field returned, but I can't get it to work in PHP. All it gets out of the db is the highest number in that field.
<?
$conn = mysql_connect("localhost", "uname", "pwerd") or die ("Could not connect to db");
mysql_select_db('heardya_com') or die("Could not select the database!");
$queryMinPic = "SELECT picNum FROM pics";
$resPicNum = mysql_query($queryMinPic, $conn);
if (!$resPicNum) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $queryMinPic;
die($message);
}
$picNum = mysql_fetch_array($resPicNum);
print_r($picNum);
?>