note 104897 added to function.oci-fetch-row
| From: | sandracmart at gamil dot com | Date: | Thu, 14 Jul 2011 13:05:50 +0000 |
| Subject: | note 104897 added to function.oci-fetch-row | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-181498@lists.php.net to get a copy of this message | ||
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];
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 190.139.130.20
----
Manual Page -- http://www.php.net/manual/en/function.oci-fetch-row.php
Edit -- https://master.php.net/note/edit/104897
Del: integrated -- https://master.php.net/note/delete/104897/integrated
Del: useless -- https://master.php.net/note/delete/104897/useless
Del: bad code -- https://master.php.net/note/delete/104897/bad+code
Del: spam -- https://master.php.net/note/delete/104897/spam
Del: non-english -- https://master.php.net/note/delete/104897/non-english
Del: in docs -- https://master.php.net/note/delete/104897/in+docs
Del: other reasons-- https://master.php.net/note/delete/104897
Reject -- https://master.php.net/note/reject/104897
Search -- https://master.php.net/manage/user-notes.php