Hi,
I've searched the archives and don't see an answer.
Could someone take a look and let me know an idea or 2 on ways to handle this sql generation , please?
I'm building a string like this:
$updateQstr = "UPDATE table SET ";
if ($LineNo1)
{ $updateQstr = updateQstr . "table.field = '$LineNo1' " ;
}
rest of sql statement built after this
The bug is occurring when the value coming in from web is $LineNo1 = '0'. Essentially user tries to update a value to zero and the string builder does not honor the value because php sees the value as not being set.
I have tried:
if (ereg("[[:digit:]]", $LineNo1))
{build string}
but this doesn't seem to work correctly.
Please help.