The following code always fills in 99999 in the client_id regardless of which client I select in the dropdown. Id is an interger. That suggests that there is nothing in the result set (which makes no sense)?
What am I missing?
/**
* Selecting a field from another table
*/
// Check for record
$check_sql = "SELECT client_id"
. " FROM bill_clients"
. " WHERE client = '" . {Client} . "'";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
{client_id} = {rs[0][0]};
}
else // No row found
{
{client_id} = '99999';
}