Author Topic: Script terminated or some other problem?  (Read 587 times)

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Script terminated or some other problem?
« on: September 21, 2011, 05:59:45 AM »
Code: [Select]
ignore_user_abort(true);
mysql_query("INSERT INTO table_a ...");
mysql_query("UPDATE table_b ...");

I'm getting reports from players that would indicate that the UPDATE part very rarely is not executed. Neither I nor my testers could reproduce it.

Any idea what could be the cause? What theoretically could cause it?

Offline jack13580

  • Level 7
  • *
  • Posts: 35
  • Reputation: +0/-0
    • View Profile
Re: Script terminated or some other problem?
« Reply #1 on: September 21, 2011, 10:52:10 PM »
unless you show the full code can't help you here

Offline capturts

  • Level 8
  • *
  • Posts: 43
  • Reputation: +1/-0
    • View Profile
    • Space Freight
Re: Script terminated or some other problem?
« Reply #2 on: September 23, 2011, 07:10:54 AM »
One suggestion I could give is maybe the update statement might be something like this:

Code: [Select]
"update my_table set foo="bar" where baz = $something"
If $something doesn't always get set to what it should be because of some rarely occurring conflict, for example, the update statement won't update anything. I suggest the following:

Code: [Select]
$query="update blah blah blah".
mysql_query($query);
file_put_contents('query.log', $query, FILE_APPEND | LOCK_EX);

This will log the query each time into query.log (make sure it's writable by the script). After a while look through and see if there are any query's with missing bits or whatever.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal