An example of oracle+PHP query_PHP tutorial

WBOY
Release: 2016-07-21 16:10:39
Original
1076 people have browsed it


http://qdlover.yeah.net
An example of oracle+PHP query
Originally I didn’t use PHP, but many friends still asked me, so I made an example. Please check the manual for specific functions
In fact, Oracle’s functions are similar to others, except that it has an additional process of defining output variables.
Anyone who has studied pl/sql knows this (but I heard that only Tsinghua University and Xi’an Jiaotong University use it Make a website).
is OCIDefineByName($id, "ROWNUM",&$rownum); corresponding to the rownum in the query, one corresponding to one,
And the most important thing to note is that when defining, the field name must be in uppercase , because Oracle does not recognize lowercase
The rest is almost the same, assignment, display, closing the cursor
$conn = ocilogon("gcxx","gcxx","server1");
$id = OCIParse ($conn,"select rownum,gcdjbh,gcmc from zbgg");
OCIDefineByName($id,"ROWNUM",&$rownum);
OCIDefineByName($id,"GCDJBH",&$gcdjbh);
OCIDefineByName($id,"GCMC",&$gcmc);

OCIExecute($id);
$i=0;
while (OCIFetch($id)) {

echo "Serial number: ".$rownum."
";
echo "Project registration number: ".$gcdjbh."
";
echo "Project name:". $gcmc."
";
$i++;
if ($i>10) break;
}
OCIFreeStatement($id);
OCILogoff($conn);
?>

(Source: Viphot)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314140.htmlTechArticlehttp://qdlover.yeah.net An example of oracle+PHP query. Originally I didn’t use PHP, but Many friends still ask me, so I made an example. Please check the manual for specific functions. In fact, oracl...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template