RE: [PHP-QA] Finding then deleting in mySQL

From: Date: Tue, 06 Aug 2002 12:03:47 +0000
Subject: RE: [PHP-QA] Finding then deleting in mySQL
Groups: php.qa 
Request: Send a blank email to php-qa+get-5690@lists.php.net to get a copy of this message
I'm afraid you sent to the wrong list as this is not QA related. You might want to try the general mailing list or the newsgroup at comp.lang.php Thanks. -----Original Message----- From: Andrew Conner [mailto:spam@microwinder.com] Sent: Tue 06/08/2002 7:44 AM To: php-qa@lists.php.net Cc: Subject: [PHP-QA] Finding then deleting in mySQL First off, I know this is probably extrememly easy, just I've thought about it too much. OK, what I have is a table (the describe is at the bottom). So far, I can run queries like: select min(EXPIRE) as lowest_expire from CreditManager where USERNAME="some@email.address" order by lowest_expire desc limit 1; and that displays the lowest EXPIRE value for a given username. Well, what I want to do in total is to get the lowest EXPIRE value from a given user, then delete that row. I can do the first part just fine... but I've tried many times to get DELETE to work, but it hasn't been (if ya know what I mean). How should I do this? I'm working in PHP, so it doesn't have to be all in mySQL to do everything. Thanks in advance! Andrew (It's a copy from phpMySQLAdmin and it messed up in the copy...but it's readable) Field Type Null Key Default Extra PID mediumint(9) PRI NULL auto_increment USERNAME tinytext EXPIRE tinyint(4) 0 PURCHASED tinytext STATUS enum('used','unused','expired') unused -- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.qa (#5690) next »