note 63397 rejected from faq.html by betz
| From: | betz@php.net | Date: | Wed, 22 Mar 2006 02:35:49 +0000 |
| Subject: | note 63397 rejected from faq.html by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106191@lists.php.net to get a copy of this message | ||
Note Submitter: mengfl at vvgroup dot com
----
I don't know how to post oracledata from form to php program.
for example:
I want to input date in form and let the date to php program and maybe we will use $_post[]
.
And how to use $_post[] in (select * from table where
a = $_post[])?
form:
<form action="example_10.php" method="POST">
Your name: <input type="text" name="beg_date" />
Your age: <input type="text" name="end_date" />
<input type="submit">
</form>
php:
example_10.php
<?php
/* oci_fetch_all example mbritton at verinet dot com (990624) */
$conn = oci_connect("apps", "apps","prod");
$stmt = oci_parse($conn, "
select *
from fnd_user
where to_char(f.creation_date,'YYYYMMDD')
between beg_date
and end_date
");
oci_execute($stmt);
$nrows = oci_fetch_all($stmt, $results);
if ($nrows > 0) {
echo "<table border=\"1\" width='200%'>\n";
echo
"<caption><b>åºæ¶æç»è¡¨</b></caption>";
echo "<tr>\n";
foreach ($results as $key => $val) {
echo "<th>$key</th>\n";
}
echo "</tr>\n";
for ($i = 0; $i < $nrows; $i++) {
echo "<tr>\n";
foreach ($results as $data) {
echo "<td>$data[$i] </td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
} else {
echo "No data found<br />\n";
}
echo "$nrows Records Selected<br />\n";
oci_free_statement($stmt);
oci_close($conn);
oci_commit($conn);
?>
how to use $_post[] in form and in php program ?