Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 0.50 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Deleting multiple rows from multiple tables MYSQL
  2. $cleanacc_1 = "DELETE FROM $acc_1
  3.     WHERE `Scheduled` < DATE_SUB(UTC_TIMESTAMP(), INTERVAL 30 SECOND)";
  4.  
  5. $result = mysql_query($cleanacc_1);
  6.        
  7. DELETE FROM t1, t2,t3 USING t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id<10 and t2.id<10 and t3.id<10.
  8.        
  9. create table account (id int unsigned primary key auto_increment, other fields...);
  10.        
  11. delete from account where condition=true;
  12.        
  13. create table transaction (id, account_id, other transaction fields);