Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select column1 from schema1.table1 where column1= ?
- select column1 from schema1.table1 where column1= 'value'::text;
- LOG: execute pdo_stmt_00000001: select column1 from schema1.table1 where column1 = $1
- DETAIL: parameters: $1 = 'value'
- LOG: statement: DEALLOCATE pdo_stmt_00000001
- select column1 from schema1.table1 where column1 = 'value';
- column1
- ---------
- VALUE
- (1 row)
- try {
- $db = new PDO('pgsql:dbname=database1;user=user;password=pass;host=localhost');
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql = "SELECT column1 from schema1.column1 where column1 = 'value'::citext ";
- $retval=$db->query($sql);
- foreach ($retval as $row) {
- print $row['uname'] . '<br>';
- }
- }catch (PDOException $PDOerr) {
- echo 'An error occured : <br>';
- var_dump($PDOerr);
- exit;
- //some thing went wrong while performing the action on db.
- }
- object(PDOException)#10 (8) { ["message":protected]=> string(211) "SQLSTATE[42704]:
- Undefined object: 7 ERROR: type "citext" does not exist LINE 1: ...
- select nspname from pg_type t join pg_namespace n
- on n.oid=t.typnamespace where typname='citext';
- $sql = "SELECT column1 from schema1.column1 where column1 = 'value'::public.citext";
Add Comment
Please, Sign In to add comment