An example of oracle + PHP query 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 )){
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.