B
brandon o
Guest
into a variable in PHP.? What I am doing is when a user submits a page to my database (mySQL) it stores the day it was submitted. I want to be able to output to a specific page all submissions within 5 days time.
Of course it will change the output daily by dropping the 5th day and picking up the current day.
The date format is Jan-23, 2009 which is stored by:
date(M, d Y);
CORRECTION:
date(M d, Y);
Modified:
Okay I have figured out how to store the new date now how do I correct this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '26, 2009 && `approval`=1' at line 1
The code is as follows:
$date = date("M d, Y");
$newdt = strftime($date, strtotime("-5 days"));
mysql_query("SELECT * FROM `dir_websites` WHERE `dateadded` > ".$newdt." && `approval`=1")
Okay nvmd the way i'm finding the previous date is still not right
$date = date("M d, Y");
$newdt = strftime($date, strtotime("-5 days"));
Of course it will change the output daily by dropping the 5th day and picking up the current day.
The date format is Jan-23, 2009 which is stored by:
date(M, d Y);
CORRECTION:
date(M d, Y);
Modified:
Okay I have figured out how to store the new date now how do I correct this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '26, 2009 && `approval`=1' at line 1
The code is as follows:
$date = date("M d, Y");
$newdt = strftime($date, strtotime("-5 days"));
mysql_query("SELECT * FROM `dir_websites` WHERE `dateadded` > ".$newdt." && `approval`=1")
Okay nvmd the way i'm finding the previous date is still not right
$date = date("M d, Y");
$newdt = strftime($date, strtotime("-5 days"));