Timeline for problems with updating database
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 7 at 9:02 | comment | added | itoctopus | My guess that the ID ($pxobjUpdate->id) is sometimes passed as empty (which could mean that the object in itself is empty). In addition, by quickly glancing at your code, I see that you have about 3 variables storing the ID, which is not good practice. One other reason is that the code might be failing at one point. | |
May 23 at 20:55 | comment | added | RogerCO | Put a try...catch around the $db->execute() and see if the query is failing for the records that don't get updated (use $query->dump() to get the full query string). If not then it must be that whatever you are using above this to select the $pxobjUpdate objects is missing some. Not sure what all of the stuff at the top before the if (debug) is doing for you. Is this all in a loop iterating over the $pxobjUpdate objects or a function that is passed a single $pxobjUpdate object to update? | |
May 21 at 22:38 | comment | added | mickmackusa | What kind of insights can you derive from this script? 3v4l.org/EcbLf | |
May 21 at 22:13 | comment | added | mickmackusa | If the process is only working sometimes, then you don't have a coding problem, you have a data problem. We cannot help you without better debilugging details. Perhaps try to implement the Debugging techniques at Correct ways to verify update query is successful under conditions then edit your question to clarify the problem. | |
May 16 at 10:51 | history | asked | user1616338 | CC BY-SA 4.0 |