Intermittent problems are difficult to resolve unless you can find a way to reliably induce the error. Furthermore, you’ve not given us much to go on. What are the values in the passed variables which are known to fail?
Taking a wild guess, if the passed arrays contain values that should be stored as numeric, there could be issues with the resulting SQL query. Especially if the table fields are not all varchar. To be safe, you should pass corresponding format arrays for $data_array and $data_where. NB: $wpdb methods only support string, integer, or float formats.
In this case I tried to post just integer and strings like current user username
Those queries will work 70% of the time.
Let me explain what i guess :
Arrays should be sort how the queries sorted ? Like this :
1 – First arrays of first query
2 – Second arrays of second query
Then queries should be written like this :
1- First query that send first arrays
2- Second query that send second arrays
Is this arrangement is important ?
Cause in my case this arrangement has not been regarded.
-
This reply was modified 6 years, 3 months ago by
TheXrion.
Your plan should work, provided everything was done correctly. If the supplied data involves integers I think it’s important to supply format field data when calling $wpdb methods. Only if everything were strings and varchar, can we safely omit them.
https://developer.wordpress.org/reference/classes/wpdb/update/
You should provide the $format and $format_where arguments in your call.