Is it possible to fetch only the last row returned from a mysql query. For example. Let's say I have
$result=mysql_query("SELECT * from mytable)
It returns many rows. the only way I know to get the data is to use a while
loop like this
while ($row=mysql_fetch_array($result)) { ... }
I know what you're thinking... Why not just do a query to SELECT
only the last row? But lets say that's out of my control. The query is already done and it's got lots of rows and I don't want to do another query. Is the only way to get the last row, to go through the entire while
loop and then look at the last data returned? Or is there a way to maybe fetch the rows backwards and stop at the first one. Actually, if it makes it any easier, I don't really even need the entire last row. I want to know what's in the last column of the last row.