Hi to all,
I have problems with querys on PgSQL. I was working up till now on MySQL database. And query's where tested just on MySQL server, i had no idea that we would be trasfering our code to PgSQL
Ok here is sample table describing this problem :
Ok, now the query that is working on MySQL :Code:CREATE TABLE "public"."partners" ( "partner_id" INTEGER DEFAULT nextval('partners_seq'::regclass) NOT NULL, "partner_name" VARCHAR(100) DEFAULT NULL::character varying )
Ok now i know this is a problem for PgSQL and when i doCode:SELECT * FROM partners WHERE partner_id='{$partner_id}'
Without " ' " sign, it works, but what when $partner_id doesn't exist.Code:SELECT * FROM partners WHERE partner_id={$partner_id}
On mysql it worked, query returned null but it didn't gave me any errors like now i'm experiencing.
Now, there is huge amount of code to recode for this is there any other way to resolve this?
Edit: Error is this => ERROR: invalid input syntax for integer: ""









Bookmarks