duniyadnd
01-06-2003, 11:07 PM
Is there any way I can find the last element of a table in a certain column besides using a while loop to go through till I reach the last element.
If its the while loop, i presume its this:
while ($row = mysql_fetch_object($Query))
{
$length = $row->id;
}
However, I want to avoid using this, because I can only call the Query once it seems, everytime I use a while loop. I also tried to use the "end" function in PhP, but no such luck, I get the last column, last element.
I couldn't figure out if this was a php problem or sql problem as I can't figure out a way of getting this in SQL and tried various methods in PhP.
-------------------------------------------------------------
Uhhhhh... yeah.. sorry moderators, wrong forum, can't figure out a way to delete -> forward to SQL please
--------------------------------------------------------------
Thanks
Duniyadnd
If its the while loop, i presume its this:
while ($row = mysql_fetch_object($Query))
{
$length = $row->id;
}
However, I want to avoid using this, because I can only call the Query once it seems, everytime I use a while loop. I also tried to use the "end" function in PhP, but no such luck, I get the last column, last element.
I couldn't figure out if this was a php problem or sql problem as I can't figure out a way of getting this in SQL and tried various methods in PhP.
-------------------------------------------------------------
Uhhhhh... yeah.. sorry moderators, wrong forum, can't figure out a way to delete -> forward to SQL please
--------------------------------------------------------------
Thanks
Duniyadnd