whynot keep all and just sort/limit them to get the data you want?
bastien
From: "bob plano" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: Re: [PHP-DB] mysql databases
Date: Sat, 14 Oct 2006 12:47:38 -0500
sorry, i meant that i wanted to remove the oldest entry and pu
Hi Bob
First you would need a means of identifying your oldest entry, some kind
of Date-Time field would seem simplest. Then, one way, would be to
SELECT the oldest value and use it in the 'where' clause of an UPDATE.
SELECT MIN(stamp) FROM table;
will get the oldest date-time value
and
UPDAT
sorry, i meant that i wanted to remove the oldest entry and put in a
new entry with UPDATE or INSERT.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi
> He means that he wants to use REPLACE and take out the old entry and update
> it with a new one. Although, you would probably use UPDATE instead.
Hmmm... Thought this was DB list, not mind-readers.
I would also *guess* that would be the intention, but his example seems
to remove the newest e
He means that he wants to use REPLACE and take out the old entry and update
it with a new one. Although, you would probably use UPDATE instead.
--
Dave W
Hi Bob
Your question isn't very clear. Do you want to remove the oldest entry,
newest, or is there some other criteria to diceide?
Niel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
how would you add something new into a table and take out something
old? example:
(1) 1st something
(2) 2nd something
(3) 3rd something
(4) 4th something
and then you add in something new so then the table would look like
(1) new something
(2) 1st something
(3) 2nd something
(4) 3rd something