note 104897 deleted from function.oci-fetch-row by thiago

From: Date: Thu, 14 Jul 2011 18:03:24 +0000
Subject: note 104897 deleted from function.oci-fetch-row by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181508@lists.php.net to get a copy of this message
Note Submitter: sandracmart at gamil dot com Reason: 4 ---- Clase PHP para consultar datos en un array y recuperar un valor scalar: <?php function conectar() { $dsn = '127.0.0.1/xe'; $conn = oci_connect('user', 'clave', $dsn); return $conn; } function consultar($sql) { $conn = conectar(); $command = oci_parse($conn, $sql); oci_execute($command); $nrows = oci_fetch_all($command, $res, null, null, OCI_FETCHSTATEMENT_BY_ROW); oci_free_statement($command); return $res; } function consultarDato($sql) { $conn = conectar(); $command = oci_parse($conn, $sql); oci_execute($command); $row = oci_fetch_row($command); return $row[0]; } ?>

« previous php.notes (#181508) next »