The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Okay... I'm drawing a blank.
I do a query... example: Code:
$qry=$db->query_read("SELECT field1,field2,field3 from vb_xyz WHERE field4='myvalue' and field8='Not_Processed'"); // SET FIELD8 TO PENDING TO STOP OVERLAPPING CRONS while ($result=$db->fetch_array($qry)) { $db->query_write("UPDATE vb_xyz SET field8='Pending' WHERE field1='$result[field1]'"); } // BEGIN PERFORMING ACTIONS, UPDATE DB FOR EACH FIELD ONCE COMPLETE while ($result2=$db->fetch_array($qry)) { // action code here // this is what is not working, "$qry" seems to be "empty" or "finished" } In the first loop, I update a given field to "Pending" status and in the second loop, I actually take action. I can't do this with one loop because I want to make sure that the Pending status is applied to the entire selected $qry before running a process, so no future spawned scripts duplicate what a previously spawned script is already attempting to complete. I know in PHP you can take an array and set the counter back to 0. But, how do I do this with the mysql query and the while clause using fetch_array? If you know of a better way to do what I want to do, Im open for suggestions. Thanks! PS - Above code is for example purposes only and not copied from my actual working code. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|