Re: [PHP-DB] PostgreSQL query many escape characters?

[email protected] (danaketh)
Newsgroups php.db
Message-ID <[email protected]>
Hi,

    you should post the INSERT query too. I'd recommend you to print the 
query before running it. Just put echo $query; before/after pg_query(). 
You'll see what are you sending to the database. This may help you find 
the problem. Also using ` instead of " in query may help you to make it 
easier to read.

------------------------
Carol Walter napsal(a):
> Hello,
>
> I am very new to this process, so please forgive me if this is a silly 
> question.  I have a number of PostgreSQL tables that use the naming 
> convention that capitalizes the first character of each word, therefor 
> the data names require quotes.  When I put together my queries using 
> parameters for the selected columns and the table names and use 
> pg_query_params instead of pg_query to build the query?  Doing it 
> without the parameterization looks like this...
>
> $query = "SELECT 
> tp.\"peopleId\",\"fName\",\"mName\",\"lName\",\"contactItem\"
>                      FROM \"tblPeople\" tp
>                       LEFT JOIN \"brdgPeopleContactInformation\" bpci 
> ON tp.\"peopleId\" = bpci.\"peopleId\"
>                       LEFT JOIN \"tblContactInformation\" tci ON 
> bpci.\"contactInformationId\" =
>                                           tci.\"contactInformationId\"
>                       WHERE (\"lName\" like '$l_name' AND \"fName\" IS 
> NULL) OR (\"lName\" like '$l_name' AND \"fName\"
>                                        LIKE '$f_name')
>                       ORDER BY \"lName\",\"fName\",\"mName\"";
>     $SciName = pg_query($query);
>
> This actually works, believe it or not, but my next query where I'm 
> doing an insert to the tables does not.
>
> Thank you in advance for your time.
>
> Carol
>
>

-- 

S pozdravem

Daniel Tlach
Freelance webdeveloper

Email: [email protected]
ICQ: 160914875
MSN: [email protected]
Jabber: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.