Jason Gerfen wrote:
> Carol Walter wrote:
>> Hello,
>>
>> I'm using PHP 5 and PostgreSQL 8.3.6. I have a query that is failing
>> and I don't know how to troubleshoot the problem. The error message
>> that it is giving is quite vague. The error message is as follows:
>>
>>
>> Warning: pg_query_params() [function.pg-query-params]: Query failed:
>> ERROR: syntax error at end of input at character 156 in
>> /home/walterc/ssl/PHP/km_input_test2c.php on line 631
>> ERROR: syntax error at end of input at character 156
>>
>> The query that is failing looks like this...
>>
>> $pg_pres_ins6 = pg_query_params("INSERT INTO \"brdgMediaCallsEvents\"
>> (\"mediumId\", \"eventId\", rank) VALUES
>> ((currval('\"tblMedia_mediumId_seq\"'),
>> (currval('\"tblCallsEvents_eventId_seq\"'), $1)", array($ev_rank));
>> echo pg_last_error($pg_connection);
>
Whoops, ignore the last one I forget a single quote after the actual sql
string
> Perhaps try:
> $pg_pres_ins6 = pg_query_params( $pg_connection, 'INSERT INTO
> `brdgMediaCallEvents` ( `mediumId`, `eventId`, `rank` ) VALUES (
> \"val1\", \"val2\", \"val3\" )', array( "ev_rank" ) );
>
> You need to read the document for this function because it looks like
> you were mis-using it.
>
> http://us3.php.net/manual/en/function.pg-query-params.php
>
>>
>> It's quite possible this is something very simple and I'm just not
>> seeing it. I commented out this query because I thought perhaps it
>> was failing because it was the last query in the program. The
>> previous query did not fail when it became the last one.
>>
>> Thanks in advance for your help.
>>
>> Carol
>
>
--
Jason Gerfen
Systems Administration/Web application development
jason.gerfen@scl.utah.edu
Marriott Library
Lab Systems PC
295 South 1500 East
Salt Lake City, Utah 84112-0806
Ext 5-9810
"Tomorrow isn't promised so we live for today"
|