I am trying to get a single result from a database, which works fine at
the sql command line. I have tried several versions of code, this being
the most recent -
<?
$sql = "select max(WarrantyID) from warrantycopy";
$result=mysql_query($sql) or die("Could not get the id number :" .
mysql_error());
while($query_data = mysql_fetch_array($result)) {
$WarrantyID = $query_data["WarrantyID"];
echo "<tr>\n";
echo "<th>Warranty ID:</th>\n";
echo "<td>$WarrantyID</td>\n";
echo "</tr>\n";
}
?>
No matter what I do I do not get the desired max id number from the column
WarrantyID. The same query works fine at the sql command line. What am I
doing wrong?
thanks
--
Chip
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]