PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



Delet Query

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> MySQL General
View previous topic :: View next topic  
Author Message
trawets



Joined: 26 Mar 2008
Posts: 1
Location: UK

PostPosted: Wed Mar 26, 2008 11:28 pm    Post subject: Delet Query Reply with quote

Hi Very Happy
I am trying to run the MySQL delete query in phpMyAdmin, now the query
runs and doesn't give any syntax errors, but it also doesn't delete
and rows

From the query you can see the table name (jos_content) and two
fields, state (-1 = unpublished) and publish_down,


Code:
DELETE FROM jos_content WHERE state=-1 AND DATE_ADD(publish_down,
INTERVAL '90' DAY) = CURRENT_DATE



so what I am trying to achieve is that any entries that are not
published and and its been 90 days since they were unpublished I would
like to delete them, but as I say it runs but does not delete any
entries so I'm guessing that there is something wrong with interval
part
any suggestions please
Back to top
View user's profile Send private message
lostboy



Joined: 02 May 2004
Posts: 4958
Location: toronto, canada

PostPosted: Thu Mar 27, 2008 3:21 am    Post subject: Reply with quote

DELETE FROM jos_content WHERE state=-1 AND publish_down = date_sub(CURRENT_DATE INTERVAL '90' DAY)
_________________
Lostboy

Cat, the other other white meat

Please read Posting Etiquette before posting

You can always try Google
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



Post new topic   Reply to topic    WeberForums.com Forum Index -> MySQL General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum






Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum