Jump to content

Recommended Posts

There was a post similar to this one but I can't find it right now

 

All this is to do is get rid of past concerts if it is before today.

 

I do have DELETE privelege for the user

 


$today = date("Y-m-d");

// Delete past events
$sql = "DELETE FROM tbl_events WHERE eventDate < '$today')";
$query = mysql_query($sql);


 

no clue why it doesnt work

Link to comment
https://forums.phpfreaks.com/topic/46292-solved-delete-past-events-from-phpmysql/
Share on other sites

i had the die statment earlier removed it to work on parts of code after.  deleteing the ) didnt fix it.

 

the date info i inserted was 2007-04-09 and in the create table statment i just defined the data type ad date()

Thats your problem, the date is in the wrong format. I would try a unix time stamp and see.

 


$today = time();

// Delete past events
$sql = "DELETE FROM tbl_events WHERE eventDate < '$today'";
$query = mysql_query($sql) or die(mysql_error());

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.