Scriptcase freezes when performing nested reads

Please could someone offer some words of wisdom. I seem to be getting nowhere. I need to step through a table reading each record then looking up values in another table to replace one field in the table i am stepping through. However attempting to lookup records in another table whilst stepping through the table causes scriptase to freeze and browser needs restarting

I am attempting to do the following

While (!$dataset_1->EOF)
{
$check_sql2='SELECT …";
sc_lookup(dataset_2,$check_sql2);

.
.
.
.

   $dataset_1->MoveNext();

}
$dataset_1->Close();

If i remove the sc_lookup command the process completes and exits as expected.

If this is a bug is there an alternative way to achieve the objective

Thanks in advance.

Cannot tell, but check that you have not mixed sc_lookup and sc_select here.

thanks for your response Albert, i have tried using both the effects are the same using either sc_select or sc_lookup causes SC to freeze.

I suspect that this is a php issue, not a scriptcase issue. What you might try is to start with the part that works and then partially apply your code until it doesn’t work. It will give you some hints where to find the problem. Add echo’s where you have to or use a debug routine to a logfile. Then you will see if it’s a freeze of scriptcase or an infinite loop in php:

function outputDebugString($log) {
$dt="
".date(‘Y-m-d H:i:s’).’ |’;
file_put_contents(’./log_’.date(“j.n.Y”).’.txti’, $dt.$log, FILE_APPEND);
}

Everytime you call outputDebugString it will write a record to your logfile.

Thanks Albert. This is worth a shot. What is strange i believe the code continues but SC freezes. I have already as you said cut out the code back to a workable state. The while MoveNext loop works fine, but when a SC_LOOKUP or SC_SELECT statement is inserted within the While - MoveNext loop thats it, SC Freezes and have to close the browser.