ECHO results of a query
Posted: Thu Sep 27, 2007 11:09 am
OK, I am new to PHP, and probably this is an easy answer:
I want to get the max number in a column, then echo that number.
I keep getting errors, and dont know where to begin.
This I know is correct, since I tested it on mysql database:
$q1 = "SELECT max(FENUMBER) from rma ";
$result=mysql_query($q1) or die ("Couldn't execute query Lesley");
This does deliver the maximum number in the column FENUMBER.
I am having problems displaying this. Here is where I am now:
$q1 = "SELECT max(FENUMBER) from rma ";
$result=mysql_query($q1) or die ("Couldn't execute query Lesley");
$row= mysql_fetch_array($result);
extract($row);
echo "$FENUMBER";
Thanks: Lesley
I want to get the max number in a column, then echo that number.
I keep getting errors, and dont know where to begin.
This I know is correct, since I tested it on mysql database:
$q1 = "SELECT max(FENUMBER) from rma ";
$result=mysql_query($q1) or die ("Couldn't execute query Lesley");
This does deliver the maximum number in the column FENUMBER.
I am having problems displaying this. Here is where I am now:
$q1 = "SELECT max(FENUMBER) from rma ";
$result=mysql_query($q1) or die ("Couldn't execute query Lesley");
$row= mysql_fetch_array($result);
extract($row);
echo "$FENUMBER";
Thanks: Lesley