Use Ora to list data from all data tables ' Email_info '
Below, we will read out the contents of the database and display the data in the ' email_info ' table as an HTML table
Related PHP Code:
PUTENV ("Oracle_sid=orasid");
$connection = Ora_logon ("username", "password");
if ($connection = = False) {
echo Ora_errorcode ($connection). ":". Ora_error ($connection). "
";
Exit
}
$cursor = Ora_open ($connection);
if ($cursor = = False) {
echo Ora_errorcode ($connection). ":". Ora_error ($connection). "
";
Exit
}
$query = "SELECT * from Email_info";
$result = Ora_parse ($cursor, $query);
if ($result = = False) {
echo Ora_errorcode ($cursor). ":". Ora_error ($cursor). "
";
Exit
}
$result = Ora_exec ($cursor);
if ($result = = False) {
echo Ora_errorcode ($cursor). ":". Ora_error ($cursor). "
";
Exit
}
echo "";
echo "Full Name Email Address
";
while (Ora_fetch_into ($cursor, & $values)) {
$name = $values [0];
$email = $values [1];
echo "$name $email
";
}
echo "";
Ora_close ($cursor);
Ora_logoff ($connection);
?>
The browsing effects of the program run are as follows:
Name Email Address
Spring springflower@163.com
Autumn Moon autumnmoon@163.com
... ...
http://www.bkjia.com/PHPjc/315633.html www.bkjia.com true http://www.bkjia.com/PHPjc/315633.html techarticle using Ora to list the data in all data tables ' email_info ' below, we will read out the contents of the database, and display the data-related PHP code in the ' Email_info ' data table as an HTML table ...