An example of an oracle+PHP query
Originally, I didn't use php anymore, but many friends still asked me, so I made an example. Please check the manual for specific functions.
In fact, the oracle function is similar to other things, but there is an additional process of defining output variables here.
Anyone who has studied pl/sql knows it (but I heard that only Tsinghua and Xi'an Jiaotong University use it to make websites).
It is OCIDefineByName($id,"ROWNUM",&$rownum); which corresponds to rownum in the query, one corresponds to one,
And the most important thing to note is that when defining, the field name must be in uppercase, because lowercase is not recognized in oracle.
The others are almost done, assign values, display, close 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)