Subject conversion error from string
Author Byron Morton
Hi all,

I hope someone can shed some light on an issue I am having. I have
searched the archives but have not been able to find a clear answer to
the error I am generating.


The code:
$eid = $_POST['R01'];
$statement = formFunctions::do_update($_POST);

if (!empty($statement)) {
$link = ibase_connect(DB_HOST, DB_USER, DB_PASS, 'ISO8859_1', '100', '3');
$stmt = "Update EDIT_EMPLOYEE SET " . $statement . " WHERE EDIT_EMPLOYEE.D01 = '" . $eid . "'";
$query = ibase_prepare($link, $stmt);
ibase_execute($query);
}

The output:

var_dump($statement); shows (data values changed for email):

string(284) "D02='Developer', D03='Byron', D04='Morton', D05='', D06='', D07='City', D08='BC', D09='postal code', D10='Canada', D11='111111', D12='', D13='', D14='', D15='', D16='', D17='111111 ', D18='', D19='', D20='', D21='', D22='', D23='1'"

print $statement; shows (data values changed for email):

Update EDIT_EMPLOYEE SET D02='Developer', D03='Byron', D04='Morton', D05='', D06='', D07='city', D08='BC', D09='postal code', D10='Canada', D11='111111', D12='', D13='', D14='', D15='', D16='', D17='111111 ', D18='', D19='', D20='', D21='', D22='', D23='1' WHERE EDIT_EMPLOYEE.D01 = '1'

The error:
[error] PHP Warning: ibase_execute(): conversion error from string
""

The formFunctions::do_update class returns my string.
The $query is being passed to an updateable view.
magic_quotes... is on in php.ini
firebird is 1.5 and php is 5.0+

The only thing I can see which contains a " is the strings container.
eg: string(4) "data"

How can I pass the strings formatted data without the container into the update statement?
Thanks for anyones insight. I am getting tunnel vision trying to find an answer through forums and php.net


--
Byron Morton | Software Developer | PFI Research Inc.