Hey, the script is working but not how it should. All it does is adds the date to my database and then changes all the values here is my code and what colums I have in my database.
Database - Table (date)
exedate | advert1 | date
null | N | 20030505
null | N | 20030505
null | N | 20030505
null | N | 20030506 *
null | N | 20030505
Code:
<? session_start();
// MySql Login
$mysqluser=nacd7152;
$domain=localhost;
$mysqlpass=mitchell;
$conn=@mysql_connect($domain, $mysqluser, $mysqlpass)
or die("Sorry Please Press The Back Button On Your Brwoser & Try Again");
//Select database
$database=DB_nacd7152;
$selectdb=@mysql_select_db($database, $conn)
or die("Sorry Please Press The Back Button On Your Brwoser & Try Again");
$date = date ("Ymd");
$query = "Select * Date where ExeDate = $date";
$Result = mysql_query($query);
If (mysql_fetch_array ($Result) ) {}
else
{
//This way your date is written
mysql_query("insert into Date (Date) values ($date)");
mysql_query("update date set advert1=\"N\" ");
}
?>
Where the databse has a star next to it is where I changed the date to see if it made a difference. I dont think it is validating it properly. Any help?
Thanks, Nixon.