I want to check something in database and then write something into it (or not).
So I’m trying this code:
$check_table = 'table1'; // Table name
$check_where = "column1 = '1'"; // Where clause
// Check for record
$check_sql = "SELECT column2, cloumn3 FROM $check_table WHERE $check_where";
sc_select(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
$other_field = {rs[0][0]};
$other_region = {rs[0][1]};
echo "<br>found: $other_field and $other_region<br>";
}
else // No row found
{
echo "<br>not found<br>";
}
And the result is this:
Fatal error: Cannot use object of type ADORecordSet_mysqlt as array in /opt/NetMake/v7/wwwroot/scriptcase/app/test/test1/test1_form_apl.php on line 1837
As you can see this is taken from standard SC example and of course works quite well if put in any Event.