note 42128 modified in function.ociparse by sixd

From: Date: Mon, 05 Oct 2009 01:47:39 +0000
Subject: note 42128 modified in function.ociparse by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-161313@lists.php.net to get a copy of this message
For those that are having trouble with error checking, i have noticed on a lot of sites that people are trying to check the statement handle for error messages with OCIParse. Since the statement handle ($sth) is not created yet, you need to check the database handle ($dbh) for any errors with OCIParse. For example: instead of: <?php $stmt = OCIParse($conn, $query); if (!$stmt) { $oerr = OCIError($stmt); echo "Fetch Code 1:".$oerr["message"]; exit; } ?> use: <?php $stmt = OCIParse($conn, $query); if (!$stmt) { $oerr = OCIError($conn); echo "Fetch Code 1:".$oerr["message"]; exit; } ?> Hope this helps someone. --was-- For those that are having trouble with error checking, i have noticed on a lot of sites that people are trying to check the statement handle for error messages with OCIParse. Since the statement handle ($sth) is not created yet, you need to check the database handle ($dbh) for any errors with OCIParse. For example: instead of: <?php $stmt = OCIParse($conn, $query); if (!$stmt) { $oerr = OCIError($stmt); echo "Fetch Code 1:".$oerr["message"]; exit; } ?> use: <?php $stmt = OCIParse($conn, $query); if (!$stmt) { $oerr = OCIError($conn); echo "Fetch Code 1:".$oerr["message"]; exit; } ?> Hope this helps someone. http://php.net/manual/en/function.ociparse.php

« previous php.notes (#161313) next »