本文整理汇总了PHP中OCI_Fetch_Array函数的典型用法代码示例。如果您正苦于以下问题:PHP OCI_Fetch_Array函数的具体用法?PHP OCI_Fetch_Array怎么用?PHP OCI_Fetch_Array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OCI_Fetch_Array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printHistory
function printHistory($history)
{
echo "<table class ='pure-table pure-table-bordered'>";
echo "<thead><tr><th>Reservation Id</th><th>Date of Departure (GMT)</th><th>Depart City</th>" . "<th>Depart Country</th><th>Arrival City</th><th>Arrival Country</th>" . "<th>Class</th><th>Number of tickets</th><th>Credit card #</th>" . "<th>COST (CAD)</th></thead>";
$it = 0;
while ($tuple = OCI_Fetch_Array($history, OCI_ASSOC)) {
$numFlights = 1;
if (array_key_exists("FID3", $tuple)) {
$numFlights = 3;
} else {
if (array_key_exists("FID2", $tuple) && array_key_exists("FID3", $tuple) != TRUE) {
$numFlights = 2;
}
}
$details = getDetails($tuple, $numFlights);
echo "<tr><td>" . $tuple['RESID'] . "</td><td>" . $details['DEPARTDATE'] . "</td><td>" . $details['DEPARTCITY'] . "</td><td>" . $details['DEPARTCOUNTRY'] . "</td><td>" . $details['ARRIVALCITY'] . "</td><td>" . $details['ARRIVALCOUNTRY'] . "</td><td>" . parseClass($tuple['PCLASS']) . "</td><td>" . $tuple['TICKET_NUM'] . "</td><td>" . parseCard($tuple['CREDITCARD']) . "</td><td>" . $tuple['TOTAL_COST'] . "</td></tr>";
echo "<tr><td>";
$flight = array("FIRSTID" => $tuple['FID1']);
if ($numFlights >= 2) {
$flight["SECONDID"] = $tuple['FID2'];
}
if ($numFlights == 3) {
$flight["THIRDID"] = $tuple['FID3'];
}
printDetails($flight, $it, 1);
echo "</td></tr>";
$it++;
}
echo "</table>";
}
示例2: printClassUseTable
function printClassUseTable($result)
{
echo "<table class=\"mytable\">";
echo "<tr>\n\t\t\t\t<th>Activity ID</th>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Start Date</th><th></th><th></th>\n\t\t\t\t<th>Start Time</th><th></th><th></th>\n\t\t\t\t<th>End Time</th><th></th>\n\t\t\t\t<th>Sessions</th>\n\t\t\t\t<th>Repeats On</th><th></th>\n\t\t\t\t<th>Room</th>\n\t\t\t\t<th>Instructor Name</th>\n\t\t\t</tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["ACTIVITY_ID"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["DAY"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["START_TIME"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["END_TIME"] . "</td><td>" . "</td><td>" . $row["NUMOFSESSIONS"] . "</td><td>" . $row["REPEATEDON"] . "</td><td>" . "</td><td>" . $row["ROOMNUM"] . "</td><td>" . $row["INSTRUCTORNAME"] . "</td></tr>";
}
echo "</table>";
}
示例3: printActivityUseTable
function printActivityUseTable($result)
{
echo "<table class=\"myTable\">";
echo "<tr>\n\t\t\t\t<th>Activity ID</th>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Day</th><th></th><th></th>\n\t\t\t\t<th>Start Time</th><th></th><th></th>\n\t\t\t\t<th>End Time</th><th></th>\n\t\t\t\t<th>Room</th>\n\t\t\t</tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["ACTIVITY_ID"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["DAY"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["START_TIME"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["END_TIME"] . "</td><td>" . "</td><td>" . $row["ROOMNUM"] . "</td></tr>";
}
echo "</table>";
}
示例4: printRentals
function printRentals($result)
{
echo "<h2>Available Equipment</h2>";
echo "<table class=\"myTable\">";
echo "<tr><th>Equipment Type</th><th>Quantity Available</th><tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["TYPE"] . "</td><td>" . $row["COUNT"] . "</td></tr>";
}
echo "</table>";
}
示例5: printItem
function printItem($result)
{
echo "<div class='Pokeguide'>";
echo "<table>";
echo "<tr><td>IID</td><td>Type</td><td>Description</td></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td></tr>";
}
echo "</table>";
echo "</div>";
}
示例6: printPoke
function printPoke($result)
{
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr>";
echo "<td><font size='5px'>Pokedex Number<br>{$row[0]}</font></td>";
echo "<td><font size='5px'>Name<br><a href = profile.php?name={$row[1]}>{$row[1]}</a></font></td>";
echo "</tr>";
echo "<tr>";
echo "<td><img src='{$row[2]}' alt='picture'></td>";
}
}
示例7: printLocation
function printLocation($result)
{
echo "<div class='Pokeguide'>";
echo '<table>';
echo '<tr><td>Location</td><td>Description</td></tr>';
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
if (strpos($row[0], 'Evolve') === false and strpos($row[0], 'LName') === false) {
echo '<tr>';
echo '<td>' . $row[0] . '</td>';
echo '<td>' . $row[1] . '</td>';
echo '</tr>';
}
}
echo "</table>";
echo "</div>";
}
示例8: printResult1
function printResult1($result)
{
//prints results from a select statement
if ($_POST["query"] == "maxMemClass") {
// print results from "class with most members"
echo "<table class=\"mytable\">";
echo "<tr><th> Member_Count </th><th> Activity_ID </th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["COUNT"] . "</td><td>" . $row["AID"] . "</td></tr>";
}
echo "</table>";
} elseif ($_POST["query"] == "teachingClass") {
echo "<table class=\"mytable\">";
echo "<tr><th> Teaching_Count </th><th> Instructor </th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["COUNT"] . "</td><td>" . $row["NAME"] . "</td></tr>";
}
echo "</table>";
} elseif ($_POST["query"] == "maxRentalItem") {
echo "<table class=\"mytable\">";
echo "<tr><th>Rental_Count</th><th>EquipID</th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["COUNT"] . "</td><td>" . $row["EID"] . "</td></tr>";
}
echo "</table>";
} elseif ($_POST["query"] == "avgClassRep") {
echo "<table class=\"mytable\">";
echo "<tr><th>Avg Number of Sessions </th><th> StartDate </th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["AVG"] . "</td><td>" . $row["DAY"] . "</td></tr>";
}
echo "</table>";
} elseif ($_POST["query"] == "classPrice") {
echo "<table class=\"mytable\">";
echo "<tr><th>Class Name</th><th>Price</th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row["N"] . "</td><td>" . $row["P"] . "</td></tr>";
}
echo "</table>";
}
}
示例9: printResult
function printResult($result)
{
//prints results from a select statement
echo "<br>Got data from table:<br>";
echo "<div class=" . "pure-table pure-table-bordered pure-table-striped" . "><table>";
echo "<tr><th>cid</th>" . "<th>email</th>" . "<th>password</th>" . "<th>cname</th>" . "<th>passport_country</th>" . "<th>passport_num</th>" . "<th>phone#</th>" . "<th>address</th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
/* echo "<tr><td>" . $row["CID"] . "</td><td>"
. $row["EMAIL"] . "</td><td>"
. $row["PASSWORD"] . "</td><td>"
. $row["CNAME"] . "</td><td>"
. $row["PASSPORT_COUNTRY"] . "</td><td>"
. $row["PASSPORT_NUM"] . "</td><td>"
. $row["PHONE#"] . "</td><td>"
. $row["ADDRESS"] . "</td></tr>"; //or just use "echo $row[0]"
*/
echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td><td>" . $row[6] . "</td><td>" . $row[7] . "</td></tr>";
//or just use "echo $row[0]"
}
echo "</table></div>";
}
示例10: printTable
function printTable($attributes, $data)
{
echo "<div class=" . "pure-table pure-table-bordered pure-table-striped" . "><table>";
// print the top row (attribute labels)
$label = "<tr>";
foreach ($attributes as $value) {
$label = $label . "<th>" . $value . "</th>";
}
echo $label . "</tr>";
// print the data rows (tuples)
while ($tuple = OCI_Fetch_Array($data, OCI_NUM)) {
$output = "<tr>";
foreach ($tuple as $value) {
$output = $output . "<td>" . $value . "</td>";
}
echo $output . "</tr>";
}
echo "</table></div>";
}
示例11: printFlights
function printFlights($flights, $locations)
{
echo "<p><br>Search Results: <br></p>";
echo "<form method='POST' action='reservation.php'>";
echo '<table class = "pure-table pure-table-bordered">';
// print the top row (attribute labels)
echo '<thead>';
echo "<tr><th>Departure Airport</th><th>City</th><th>Country</th>" . "<th>Arrival Airport</th><th>City</th><th>Country</th><th>Departure Time (GMT)</th>" . "<th>Total Flight Time</th><th>COST (CAD)</th><th>Choose Flight</th></tr>";
echo '</thead>';
// print the data rows (tuples)
$it = 0;
while ($flight = OCI_Fetch_Array($flights, OCI_ASSOC)) {
$printout = "<tr>";
foreach ($locations as $value) {
$printout = $printout . "<td>{$value}</td>";
}
$departtime = parseDate($flight['DT1'], 1);
$flighttime = parseDate($flight['TOTALTIME'], 2);
$cost = $flight['TOTALPRICE'];
$fclassint = 0;
// Variable costs depends on class
if (strcmp($_COOKIE['flightclass'], "economy") == 0) {
$cost *= 1;
$fclassint = 1;
} else {
if (strcmp($_COOKIE['flightclass'], "business") == 0) {
$cost *= 3;
$fclassint = 3;
} else {
if (strcmp($_COOKIE['flightclass'], "first") == 0) {
$cost *= 5;
$fclassint = 5;
}
}
}
// update the cost if the class is changed
$flight['TOTALPRICE'] = $cost;
// Add class and num tickets to the post array
$flight['CLASS'] = $_COOKIE['flightclass'];
$flight['CLASSINT'] = $fclassint;
$flight['NUMTICKETS'] = $_COOKIE['numtickets'];
$flight_string = serialize($flight);
echo $printout . "<td>{$departtime}</td><td>{$flighttime}</td><td>{$cost}</td>";
echo "<td><input type='radio' name='flightchoice' value='{$flight_string}' required></td></tr>";
echo "<tr><td>";
printDetails($flight, $it, 1);
echo "</td></tr>";
$it++;
}
echo "</table>";
echo "<input type='submit' value='Book my flight'></form>";
}
示例12: printResult
function printResult($result)
{
//prints results from a select statement
echo "<div class='content-customer-area'>";
echo "<br>Got data from table:<br>";
echo "<div class=" . "pure-table pure-table-bordered pure-table-striped" . "><table>";
echo "<tr><th>cid</th>" . "<th>email</th>" . "<th>password</th>" . "<th>cname</th>" . "<th>passport_country</th>" . "<th>passport_num</th>" . "<th>phone#</th>" . "<th>address</th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td><td>" . $row[6] . "</td><td>" . $row[7] . "</td></tr>";
//or just use "echo $row[0]"
}
echo "</table></div></div>";
}
示例13: printTable
function printTable($result)
{
echo "<div class='Pokeguide'>";
echo "<table>";
echo "<tr>";
echo "<td>Trainer Name</td>";
echo "</tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
for ($i = 0; $i < 15; $i++) {
if ($row[$i] != null) {
echo "<tr><td>" . $row[$i] . "</td></tr>";
}
//or just use "echo $row[0]"
}
}
echo "</table>";
echo "</div>";
}
示例14: printResult
function printResult($result)
{
//prints results from a select statement
echo "<br>Got data from table customers:<br>";
echo "<table>";
echo "<tr><th>User</th>" . " " . "<th>Address </th>" . " " . "<th>Password </th>" . " " . "<th>Phone </th></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . " " . $row["USERNAME"] . " </td><td>" . " " . $row["ADDRESS"] . " </td><td>" . " " . $row["PASSWORD"] . "</td><td>" . " " . $row["PHONE"] . "</td></tr>";
//or just use "echo $row[0]"
}
echo "</table>";
}
示例15: executePlainSQL
//EXTRACT DATA FROM TYPES TABLE
$Type_is = executePlainSQL("SELECT * from type_is");
echo "<table>";
echo "<tr><td>Attack\\Defense</td>";
//=============FIRST ROW FOR THE TABLES
while ($row = OCI_Fetch_Array($Type_is, OCI_BOTH)) {
if ($row[0] != 'Nothing') {
echo "<td>{$row['0']}</td>";
}
}
//=========================
echo "</tr>";
//=============REST OF ROWS
$RestType = executePlainSQL("SELECT * from type_is");
//REST OF THE TABLE
while ($row = OCI_Fetch_Array($RestType, OCI_BOTH)) {
if ($row[0] != 'Nothing') {
echo "<tr>";
for ($x = 0; $x < 16; $x++) {
if ($row[$x] == 2) {
echo "<td bgcolor='#00CC00'>{$row[$x]}</td>";
} else {
if ($row[$x] == 0.5) {
echo "<td bgcolor='#FF0000'>{$row[$x]}</td>";
} else {
if ($row[$x] == 0) {
echo "<td bgcolor='#C2C2A3'>{$row[$x]}</td>";
} else {
echo "<td>{$row[$x]}</td>";
}
}