Results 1 to 9 of 9
Thread: queries are not fully executing
Jan 29, 2010, 09:16 #1
- Join Date
- Feb 2005
- was rainy Oregon now sunny Florida
- 2 Post(s)
- 0 Thread(s)
queries are not fully executing
I have a problem with a high traffic (mysql) script page.
What the script does is archive users that have expired according to time used up. The "sessionaccounting" table can have 1 to thousands of enties (24 columns) for a single user.
What's happening is that sometimes when records are moved the script bails out and doesnt move data from all of the tables.
I suspect that this is caused by concourant hits to the script ie.. the script is archiving a lot of records and the in the middle of archiving the script gets called again.
Here is the code
$q1= "INSERT into asessionaccounting select * FROM sessionaccounting where UserName = '" . $row['UserName'] . "' "; $update1 = mysql_query($q1) or die(mysql_error()); // there are seven more similar inser/select queries here //then the delete (seven more of these) $qd1= "DELETE FROM sessionaccounting WHERE UserName = '" . $row['UserName'] . "' "; $updated1 = mysql_query($qd1) or die(mysql_error());
Does anyone have any ideas as to what may be happening and more importantly how can it be fixed.
LorenWhat I lack in acuracy I make up for in misteaks