I am having trouble with the following SQL. It works fine directly in MySQL but my PHP web page prints nothing. Does anyone have a clue why this is happening?
The variables to connect to MySQL are set up properly. Other queries in the page work fine. I'm new to using MIN and this may be the problem.
- - picklefish - -
Code:
$Link = mysql_connect ($Host, $User, $Password);
$Query = "SELECT MIN(myfield) FROM `mytable`";
$Result = mysql_db_query ($DBName, $Query, $Link);
while ($Row = mysql_fetch_array ($Result)) {
print ("$Row[myfield]");
}
mysql_close ($Link);
The variables to connect to MySQL are set up properly. Other queries in the page work fine. I'm new to using MIN and this may be the problem.
- - picklefish - -