Terrible-PHP and Postgres
| From: | Enrico Comini | Date: | Sat, 19 Aug 2000 12:40:37 +0000 |
| Subject: | Terrible-PHP and Postgres | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2181@lists.php.net to get a copy of this message | ||
It's terrible,
I have many lines like
$conn = pg_connect("host=$host port=$port dbname=$database user=$user");
$sql_item = "insert into carts_cust
values($cartID,'$fname','$lname','$company')";
$result = pg_exec($conn,$sql_item);
Seems all right
But the problem discovered is when there is a ' in a variable.
Example
$fname = coco'
How is possible solve this problem ?
Thanks
Enrico