djbaxter
03-14-2007, 04:05 PM
What is wrong with this query?
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
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:
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?
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
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:
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?