PostgreSQL - ERROR Attribute not found ?!

admin

Administrator
Staff member
I have a query look something like this:
INSERT INTO test (id, test) VALUES ('$id', '$test');

It shows the attribute error when the query look like this:
INSERT INTO test (id, test) VALUES (\"$id\", \"$test\");

My problem is, if I used the first query, it works but the $test variable may contain apostrophy ( ' ). Therefore, when the query try to insert such data into the database, it shows error. I couldn't use the second query for it will cause the attribute error. I really don't know of what can I do then.

Any idea of how can I get around with it ?

p/s : What does the error means by the way. I'm sorry to ask such silly question but I'm new to PostgreSQL. If there's any site is good for PostgreSQL + PHP newbie, please tell it to me.

Thanks in advance!
 
Back
Top