Subject | Re: conversion error from string |
---|---|
Author | unixfirewalls |
Post date | 2005-08-25T22:04:09Z |
--- In firebird-php@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
Nullable (the submit is into a view where the PK etc is not visible),
the problem seems definitly to be squarely in the fields which are
posted with no value ( D='' ). I have changed the POST to include only
filled-in fields and the execute works (still with the data encased in
single quotes). I will remove the quotes on real integers as an
alternative.
As an aside, any thoughts why would I get the html value for a double
quote in the error when/if the quote is a single quote? That little
tidbit has got me hunting all over for a (") when I should have been
looking at the (').
-byron
wrote:
> > Hi all,answer to
> >
> > 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
> > the error I am generating.string
> >
> >
> > 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
> > ""container.
> >
> > 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
> > eg: string(4) "data"e.g. the
> >
> > 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.
>
> sounds more like your procedure is expecting an integer parameter
> where clause, and I see you are passing a string '1' where as itshould be 1
> without the enclosed single quotes. Sam goes for the other fieldswhich you
> are enclosing all of them in single quotes. Try not enclosing thereal
> integers.Thanks for the insight Alan. Although all the changeable fields are
> Alan
Nullable (the submit is into a view where the PK etc is not visible),
the problem seems definitly to be squarely in the fields which are
posted with no value ( D='' ). I have changed the POST to include only
filled-in fields and the execute works (still with the data encased in
single quotes). I will remove the quotes on real integers as an
alternative.
As an aside, any thoughts why would I get the html value for a double
quote in the error when/if the quote is a single quote? That little
tidbit has got me hunting all over for a (") when I should have been
looking at the (').
-byron