I am attempting to pull out some items from a mysql DB and place it into an array. The goal is to have an array so that I can compare 1 variable ($row[0]) to another set variable. Then from that comparison take the second variable ($row[1]) and use that to requery the database.
$timestamp = time();
$drop_dead = mysql_query("SELECT drop_dead, ID FROM eblasts") or die(mysql_error());
while ($row = mysql_fetch_array($drop_dead, MYSQL_NUM)) {
$last_time[][] = $row[0];
$last_time[][] = $row[1];
};
foreach($last_time as $value) {
if($timestamp > $value){
$final_email[] = $value;
};
};
print_r($final_email)
Hopefully that makes sense. Anyone have a better solution? This isn’t working …
There are 4 fields in the DB. drop_dead, warning1, warning2 and due_date. Each one of these is a unix time stamp. I need to send an email if that time has past. So I want to look up the drop_dead date from the DB (which will be the latest time an email should be sent) see how it compares to the current time. Then requery the DB and see which email should be sent out warning1, warning2 etc.
Make sense?
Thanks in advance.
-Adam
why not:
assuming that $row[0] is the timestamp and $row[1] is the email..