note 99578 added to function.oci-execute

From: Date: Wed, 25 Aug 2010 08:35:48 +0000
Subject: note 99578 added to function.oci-execute
Groups: php.notes 
Request: Send a blank email to php-notes+get-172035@lists.php.net to get a copy of this message
Notice (PHP 5.2.12-pl0-gentoo): <?php $q = oci_parse($c, ""); if($q != false){ // parsing empty query != false if(oci_execute($q){ // executing empty query != false if(oci_fetch_all($q, $data, 0, -1, OCI_FETCHSTATEMENT_BY_ROW) == false){ // but fetching executed empty query results in error (ORA-24338: statement handle not executed) $e = oci_error($q); echo $e['message']; } } else{ $e = oci_error($q); echo $e['message']; } } else{ $e = oci_error($link); echo $e['message']; } ?> You can parse empty query, you can execute empty query (returns true), but you cannot fetch data from empty query. So, if you provide query as variable, make sure it isn't empty. ---- Server IP: 69.147.83.197 Probable Submitter: 195.234.144.22 ---- Manual Page -- http://www.php.net/manual/en/function.oci-execute.php Edit -- https://master.php.net/note/edit/99578 Del: integrated -- https://master.php.net/note/delete/99578/integrated Del: useless -- https://master.php.net/note/delete/99578/useless Del: bad code -- https://master.php.net/note/delete/99578/bad+code Del: spam -- https://master.php.net/note/delete/99578/spam Del: non-english -- https://master.php.net/note/delete/99578/non-english Del: in docs -- https://master.php.net/note/delete/99578/in+docs Del: other reasons-- https://master.php.net/note/delete/99578 Reject -- https://master.php.net/note/reject/99578 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#172035) next »