Dear All
i have two form:
1) login.php
2) main.php
I send info for oracle database login userid and password through login.php and call main.php through submit method.
in main.php, I am able to connect to oracle database first time on entering main.php main page via Login.php. when i call "query" method it given error not connectd.
What i want:
1) the main.php page remain connected to database, untill i disclose the connection.
2) I might have few other methods, like insert, update in different submit actions in the same page.
FOLLOWING IS MY CODE OF MAIN.PHP:
[code=php]<form action="main.ph p" method="POST">
<div align="center">
<br><br>
<input type="text" name=artdescr size="30" value="Enter Art Description!">
<input type="submit" name="Query" value="Query" />
</div>
</form>
<form action="main.ph p" method="post"
enctype="multip art/form-data">
<label for="file">File name :</label>
<input type="file" name="file" id="file" />
<br />
<label for="submit">Up load to Server :</label>
<input type="submit" name="fload" value="File Load" />
</form>
<?php
session_start() ;
$_SESSION['uuname'] = $_POST['username'];
$_SESSION['uupswd'] = $_POST['password'];
$uid = $_SESSION['uuname'];
$pwd = $_SESSION['uupswd'];
$conn=OCI_conne ct($uid, $pwd, "ho");
?>
<?php
if (isset($_POST['fload']))
{
do something;
}
if (isset($_POST['Query']))
{
$artnono = isset($_REQUEST['artdescr']) ? $_REQUEST ['artdescr'] : '';
function exe_query ($artnono)
{
$stmt = "SELECT art_no, descr, art_grp_no FROM article WHERE descr like $artnono";
oci_execute($st mt);
while (ocifetch($stmt ))
{
$artno = oci_result($stm t, "ART_NO");
$artname = oci_result($stm t, "DESCR");
$grpno = oci_result($stm t, "ART_GRP_NO ");
// Do something with the data
echo "Art no:=$artno ";
echo "Art descr:=$artname ";
echo "Grp No:=$grpno<br />\n";
}
oci_free_statem ent($stmt);
}
exe_query($artn ono);
}
?>
[/code]
---
Regards
S.Garewal
i have two form:
1) login.php
2) main.php
I send info for oracle database login userid and password through login.php and call main.php through submit method.
in main.php, I am able to connect to oracle database first time on entering main.php main page via Login.php. when i call "query" method it given error not connectd.
What i want:
1) the main.php page remain connected to database, untill i disclose the connection.
2) I might have few other methods, like insert, update in different submit actions in the same page.
FOLLOWING IS MY CODE OF MAIN.PHP:
[code=php]<form action="main.ph p" method="POST">
<div align="center">
<br><br>
<input type="text" name=artdescr size="30" value="Enter Art Description!">
<input type="submit" name="Query" value="Query" />
</div>
</form>
<form action="main.ph p" method="post"
enctype="multip art/form-data">
<label for="file">File name :</label>
<input type="file" name="file" id="file" />
<br />
<label for="submit">Up load to Server :</label>
<input type="submit" name="fload" value="File Load" />
</form>
<?php
session_start() ;
$_SESSION['uuname'] = $_POST['username'];
$_SESSION['uupswd'] = $_POST['password'];
$uid = $_SESSION['uuname'];
$pwd = $_SESSION['uupswd'];
$conn=OCI_conne ct($uid, $pwd, "ho");
?>
<?php
if (isset($_POST['fload']))
{
do something;
}
if (isset($_POST['Query']))
{
$artnono = isset($_REQUEST['artdescr']) ? $_REQUEST ['artdescr'] : '';
function exe_query ($artnono)
{
$stmt = "SELECT art_no, descr, art_grp_no FROM article WHERE descr like $artnono";
oci_execute($st mt);
while (ocifetch($stmt ))
{
$artno = oci_result($stm t, "ART_NO");
$artname = oci_result($stm t, "DESCR");
$grpno = oci_result($stm t, "ART_GRP_NO ");
// Do something with the data
echo "Art no:=$artno ";
echo "Art descr:=$artname ";
echo "Grp No:=$grpno<br />\n";
}
oci_free_statem ent($stmt);
}
exe_query($artn ono);
}
?>
[/code]
---
Regards
S.Garewal
Comment