An oracle + PHP query example _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.