What is wrong with this query?
Code:
DELETE FROM vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time
I am trying to run it from this PHP utility but it also gives me an error run from phpMyAdmin:
PHP Code:
<?php
require ("global.php");
$time = time() - (90 * 24 * 60 * 60);
$query = "DELETE FROM vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time";
mysql_query($query);
print $query;
?>
This version seems to work:
Quote:
DELETE FROM vbpmtext, vbpm, vbpmreceipt USING vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time
|
in the sense that it doesn't generate a syntax error. Anyone see anything wrong with that?