Hello all. Basically what I am looking to do is to pull everything from my database where an entry occured after the last know timestamp.
I ran a test on this, by entering myself into the database with a NOW() timestamp, then whated a few seconds and entered an item using NOW().
If the code below, if I set "added <=" which is not what I want, I get everything in my DB returned, including the new one I added after I "subscribed".
If I set "added >=" which I need, then I get no return.
Here is what my timstamps look like:
Item :: 20050116113344
Subscriber :: 20050116105750
$now = $myDb->dbFetch("SELECT DATE_FORMAT(NOW(), '%Y%m%d%h%i%s')");
$emails = $myDb->dbFetch("SELECT * FROM ".$prefix."subscribers WHERE active='Y' AND last < ".$now[0][0]."");
$new_entries = $myDb->dbFetch("SELECT * FROM ".$prefix."inventory WHERE added >= ".$now[0][0]."");
foreach($emails as $email){
echo "Email to >> <b>".$email['email']."</b><br><br>";
$body = "Thank you for your subscription to our website.<br><br>Here are the newly added items as requested:<br><br>";
foreach($new_entries as $entry){
$body .= '<a href="'.$tb_config[0]['url'].'inventory_item.php?id='.$entry['uid'].'">'.$entry['year'].' '.$entry['model'].'</a>';
}
echo "Body >> ".$body;
}
Any help would be awesome!