An oracle + PHP query example. Qdlover.yeah.net an oracle + PHP query example originally I don't need php, but there are still a lot of friends asked me, I made an example, the specific function please refer to the manual in fact oracl http://qdlover.yeah.net
An oracle + PHP query example
I didn't need php anymore, but a lot of friends asked me, so I made an example. for details about the function, please refer to the manual.
In fact, oracle functions are similar to others, but here it has an additional process to define output variables,
Anyone who has studied pl/SQL knows this (but I heard that only Tsinghua and Xi'an Jiaotong University use it as their websites ).
That is, OCIDefineByName ($ id, "ROWNUM", & $ rownum); corresponds to the rownum in the query,
The most important thing to note is that the field name must be in upper case during definition, because oracle does not recognize lower case letters.
The rest is almost the same. assign values, display, and close 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 "No.:". $ rownum ."
";
Echo "project registration no.:". $ gcdjbh ."
";
Echo "Project name:". $ gcmc ."
";
$ I ++;
If ($ I> 10) break;
}
OCIFreeStatement ($ id );
OCILogoff ($ conn );
?>
(Source: Viphot)
Http://www.bkjia.com/PHPjc/314140.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/314140.htmlTechArticlehttp://qdlover.yeah.net an oracle + PHP query example originally I don't need php, but there are still a lot of friends asked me, I made an example, the specific function please refer to the manual actually else l...