note 36557 modified in function.oci-execute by sixd

From: Date: Wed, 11 Nov 2009 00:34:04 +0000
Subject: note 36557 modified in function.oci-execute by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-162733@lists.php.net to get a copy of this message
Whereas MySQL doesn't care what kind of quotes are around a LIKE clause, ociexecute gives the error: ociexecute(): OCIStmtExecute: ORA-00904: "NM": invalid identifier for the following. <?php $sql = "SELECT * FROM addresses " . "WHERE state LIKE \"NM\""; // error! $stmt = ociparse($conn, $sql); ociexecute($stmt); ?> it's fine if you just use single quotes: . "WHERE state LIKE 'NM'"; but i think it's interesting that ociparse doesn't say anything --was-- Whereas MySQL doesn't care what kind of quotes are around a LIKE clause, ociexecute gives the error: ociexecute(): OCIStmtExecute: ORA-00904: "NM": invalid identifier for the following. <?php $sql = "SELECT * FROM addresses " . "WHERE state LIKE \"NM\""; // error! $stmt = ociparse($conn, $sql); ociexecute($stmt); ?> it's fine if you just use single quotes: . "WHERE state LIKE 'NM'"; but i think it's interesting that ociparse doesn't say anything http://php.net/manual/en/function.oci-execute.php

« previous php.notes (#162733) next »