Control App to update another table

Hi,

I am trying to create a control application to update same fields in a mysql table. I keep getting this error:

Error while accessing the database:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Between 79090200 AND 79090211 '' at line 1

Here is the code that runs on validate:

/**
 * Update a record on another table
 */

// SQL statement parameters
$update_table  = 'awb';      // Table name
$update_where  = "no 'Between {from} AND {to}'"; // Where clause
$update_fields = array(   // Field list, add as many as needed
     "status = 'I'",
     "aid = '{agent}'",
 );

// Update record
$update_sql = 'UPDATE ' . $update_table
    . ' SET '   . implode(', ', $update_fields)
    . ' WHERE ' . $update_where;
sc_exec_sql($update_sql);

I tried to run the query with sc_exec_sql but that didnt work either.

Any help on what Im doing wrong would be much appreciated. Thanks

I think you need to delete the , in “aid = ‘{agent}’”,

Hi,
you also have to change your WHERE clause:

$update_where = “no Between {from} AND {to}”; // too many quotation marks

jsb

Thank you guys so much. Fresh eyes always help!