This is the table structure-
Table: test
+------+---------+
| PAGE | CONTENT |
+------+---------+
| 1 | ABC |
+------+---------+
| 2 | DEF |
+------+---------+
| 3 | GHI |
+------+---------+
PAGE is a Primary with datatype INT(11). It does not auto-increment. CONTENT is of the datatype TEXT.
In PHP I do-
$result = mysql_query(SELECT MAX(PAGE) FROM test);
$row = mysql_fetch_array($result);
echo $row["PAGE"];
No output. At all. If I do something like echo "Value : ".$row["PAGE"]; all I see is Value :
The query SELECT * FROM test works just fine though. Am I wrong somewhere using the MAX() syntax?
I want it to return the maximum value of PAGE as of yet.
SELECT MAX(PAGE) as PAGE FROM testinstead and see if theres any difference?