Home  |  Linux  | Mysql  | PHP  | XML
From:Jason Gerfen Date:Tue Jun 16 16:08:32 2009
Subject:Re: Postgres query failing, not enough info for debugging...
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"
Navigate in group php.db at sever news.php.net
Previous Next


Your recent visits
Re: [PHP-DB] MIME Alternatimve Emails
Re: [PHP-DB] Cannot connect to MySQL
Re: Cannot connect to MySQL
RE: [PHP-DB] Database management
RE: [PHP-DB] finding out if a user left our website ?



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants