Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Mysql Help
post Mar 18 2004, 06:27 PM
Post #1

LinuxHelp Admin

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1

I'm too lazy to bother looking this up so I'm hoping one of you guys knows.

Is there an SQL query I can run to see what the last entry added to a peticular table was?

I suppose I'm going to have to add a date column to the database and start adding in the date added... is there anyway to do this without it?

Go to the top of the page
+Quote Post
post Mar 18 2004, 08:05 PM
Post #2

Its GNU/

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151

I can do it with 2 querys ....

$A = "select count(*) from table";
$result = mysql_query($A);

$B="select field from table LIMIT ($result-1),1";
$result2 = mysql_query($B);

Johnny Hughes
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 25th April 2018 - 01:52 AM