date()

A

Anonymous

Guest
Im tring to get a date from my database.. and send the user an email on the an event that the user has ..the part of quering the date out is easy.. but.. the part on creating a mail script to send an email on that date.. is where im confused at.. can someone post me an example on how to do this.. i figure it would go something like....
Code:
$A = mysql_query("SELECT * FROM events ORDER BY uid DESC ");
 WHILE ($rows =  mysql_fetch_assoc($A)){
     $uid = $rows['uid'];
	 $datestart = $rows['datestart'];
	 $title = $rows['title'];
}

$today = date("Y-n-j");

if($today == $datestart){
echo $datestart;
}else{
  echo $datestart;
  echo "something is wrong";
 }
 
You have format Y-m-d in your table?

SELECT * FROM events WHERE datestart=NEW() ORDER BY uid DESC
 
this is what i have in my table.. 2003-02-24
so i figure.. its the same since it prints out the same

and when i did what you said i got this error...

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xlord/public_html/evnt.php on line 20
something is wrong
 
echo $today = date("Y-n-j");
echo $today = date("Y-m-d");
 
err ya see what im tring to do.. is email them on that sertain date like an auto email.. that date i added it on an event that i added just to test out the script
 
Back
Top