Hello. I’m having trouble with sc_lookup. I’m using the following code in an Ajax On Change event;
//Lookup City and State using info from PayoffZip field
sc_lookup(my_data, “SELECT city, state FROM tblzipcodes WHERE Zip={PayoffZip}”);
{
$Payoffcity = {my_data[0][0]};
$Payoffstate = {my_data[0][1]};
}
{
echo $Payoffcity;
echo $Payoffstate;
}
// Standard Scriptcase Insertion
$insert_table = ‘tblvehicles’; // Table name
$insert_fields = array( // Field list, add as many as needed
‘PayoffCity’ => “’” . {PayoffCity} . “’”,
‘PayoffState’ => “’” . {PayoffState} . “’”,);
The echo part works and shows the correct results but my fields PayoffCity and PayoffState are not updated.
Any help greatly appreciated:)