works under mysql 5 but not under Oracle 11g1
[email protected] (Fred Silsbee)
| Newsgroups | php.db |
|---|---|
| Message-ID | <[email protected]> |
//construct a global variable for the form profile
$fields = array("fdate", "actype", "acid", "nlandings", "nhours");
problem down in while loop
.. . . . . .
function displayDeleteForm(){
//get $fields into the function namespace
global $fields;
global $conn;
/* Create and execute query. */
// $query = "select * from log_book_id";
// $result = mysql_query($query);
// Loop through each row, outputting the actype and name
echo <<<HTML
Pilots Logbook entries stored in mySQL Relational Database
under Redhat Fedora 8 Linux
<form action="{$_SERVER['PHP_SELF']}" method="post">
<table width="50%" align="center" border="1">
<tr>
<th>checked</th>
<th>rowID</th>
<th>fdate</th>
<th>actype</th>
<th>acid</th>
<th>nlandings</th>
<th>nhours</th>
</tr>
HTML;
//get log_book_id table information
$user = "select * from log_book_id";
$result = oci_parse($conn, $user);
$r = oci_execute($result);
//display log_book_id information
$count = 0;
while ($newArray = oci_fetch_assoc($result)) {
foreach ($fields as $field){
${$field} = $newArray[$field]; // values not making it into variable
}
$rowID = $newArray['rowID'];
//note that we do not rely on the checkbox value as not all browsers submit it
//instead we rely on the name of the checkbox.
echo <<<HTML
<TR>
<td>
<input type="checkbox" name="checkbox[$rowID]" value="$rowID">Check to delete record
</td>
<TD>$rowID</TD>
<TD>$fdate</TD>
<TD>$actype</TD>
<TD>$acid</TD>
<TD>$nlandings</TD>
<TD>$nhours</TD>
</TR>
HTML;
} // while
echo <<<HTML
<tr>
<td colspan="7">
<input type="submit" name="delete" value="delete checked items"/>
<input type="submit" name="new" value="New Log Entry" />
<input type="reset" name="reset" value="Reset Form" />
</td>
</tr>
</table>
</form>
HTML;
} //close function