BR
asked on
PHP sql data selection and compare
// I have problem. it does not take tha date and assign it to the $date_comingfrom_database
what should I do?
$query = "SELECT Email,Date FROM Mytable where Email='$visitoremail'";
$sql=mysql_query($query);
$result = mysql_fetch_array($query); // I have error message Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /
// I have problem here it does not take tha date and assign it to the $date_comingfrom_database
$date_comingfrom_database = $result['Date'];
$databaseemail =$result['Email'];
$todaysdate = date('Y-m-d H:i:s');
if ( ( strtotime('Y-m-d H:i:s') - strtotime($date_comingfrom _database) >= 50 ) && ($databaseemail = $visitormail))
{
echo "record exist." . $date_comingfrom_database . " ".$databaseemail. " ".$visitormail ;
}
else
{
echo "record not exist." . $date_comingfrom_database . " ".$databaseemail. " ".$visitormail ; // it only writes record not exist. and $visitormail here
}
I'll be back in 25 minutes..
what should I do?
$query = "SELECT Email,Date FROM Mytable where Email='$visitoremail'";
$sql=mysql_query($query);
$result = mysql_fetch_array($query);
// I have problem here it does not take tha date and assign it to the $date_comingfrom_database
$date_comingfrom_database = $result['Date'];
$databaseemail =$result['Email'];
$todaysdate = date('Y-m-d H:i:s');
if ( ( strtotime('Y-m-d H:i:s') - strtotime($date_comingfrom
{
echo "record exist." . $date_comingfrom_database . " ".$databaseemail. " ".$visitormail ;
}
else
{
echo "record not exist." . $date_comingfrom_database . " ".$databaseemail. " ".$visitormail ; // it only writes record not exist. and $visitormail here
}
I'll be back in 25 minutes..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome :)
ASKER
thank you