Hi...
I'd like to have a query result where I can get the results all the way up to the last row, but not include that last row in the result.
For example:
USERS Table:
id | name | address | phone_no | email |
---------------------------------------------------------
01 | Bob | 123 Jasmin | 234-2345 | [email]bob@email.com[/email] |
02 | Will | 345 Raymond | 080-4363 | [email]will@email.com[/email]|
03 | Frank | 243 Yellow | 098-2453 | [email]frank@aol.com[/email] |
04 | Larry | 934 Opel | 823-9492 | [email]larry@aol.com[/email] |
$connect = @mysql_connect("localhost", "username", "password") or die(mysql_error());
$db = @mysql_select_db("database", $connect) or die(mysql_error());
$query = "SELECT * FROM users ORDER BY id";
$result = @mysql_query($query, $connect) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$name = $row['name'];
$address = $row['address'];
$phone = $row['phone_no'];
$email = $row['email'];
}
What I'd like to be able to do is get every result EXCEPT the last one (in this case, id# 04). I know there's a command that can be used (ie, "Less"), but I'm unfamiliar with it's use.