IS my syntax correct?
/**
- Check for an existing record
*/
// SQL statement parameters
$check_table = ‘loancompmaster’; // Table name
$check_where = “PartNo = ‘[glo_id]’ && Branch = ‘{BranchReq}’”; // Where clause
// Check for record
$check_sql = ‘SELECT *’
. ’ FROM ’ . $check_table
. ’ WHERE ’ . $check_where;
sc_select(dataset, $check_sql);
if (false == {dataset})
{
sc_error_message(Error Found!!!);
}
elseif ({dataset}->EOF)
{
$insert_sql = ‘insert into loancompmaster (PartNo,PartDesc,Branch,Qty)’
. ‘values(’[glo_id]’,’[glo_desc]’,’{BranchReq}’,’{LoanQty}’)’;
sc_exec_sql($insert_sql);
}
else
{
$current_qty = $dataset->field[5];
$inv_qty = $current_qty + {LoanQty};
}