This topic is locked
[SOLVED]

 Update Multiple Records

11/28/2011 9:07:16 PM
PHPRunner General questions
C
Cyclones author

I found the sample of how to update multiple records in the manual but I'm missing something. I want to take a table named "Support" and update the field "Invoiced" for any records I've selected in the list page. I've modified the sample but I'm missing something. I get the message saying updated but the records never change.
Here's my code...
Server Page:

global $dal;
for ($i=0; $i<count($keys); $i++)
{
// set ReportsTo field to 'Bob Smith'
$sql = "Update Support set Invoiced='1' where KeyField="
. $keys[$i]["KeyField"];
CustomQuery($sql);
}
$result["txt"] = "Records were updated.";
Client After Page:

var message = result["txt"] + " !!!";

ctrl.setMessage(message);

Sergey Kornilov admin 11/28/2011

Make sure that your key column name is in fact KeyField

C
Cyclones author 11/29/2011



Make sure that your key column name is in fact KeyField


Would that be my SupportID field? And if so, would I replace both references to Keyfield with his field.

Sorry, still a newbie with this.

C
cgphp 11/29/2011

Yes, it is your SupportID field. Replace both references.

C
Cyclones author 11/29/2011



Yes, it is your SupportID field. Replace both references.


Fantastic. Thanks.