Jump to content

Archived

This topic is now archived and is closed to further replies.

austine_power007

PHP button problem

Recommended Posts

Hi all this is my 1st post on this forum i found that this is a gr8 forum for newbies like me who wants to learn PHP. I am in a gr8 trouble plzz help me: i am doing my final yr project using PHP and ORACLE so i just made a test form to check that the form cam connect to the database or not and try to insert some data. but its works fine but when i put a button than the button is not working so how i can make it work plzz help me itss URGENT!!!!!!!!!

here is the code:

<?php

$c=OCILogon("scott", "tiger", "tanvir");

if ( ! $c )
{
echo "Unable to connect: " . var_dump( OCIError() );
die();
}

if(isset($_POST['submit']))
{
$name=$_POST['Name'];
$id=$_POST['ID'];
$s = OCIParse($c, "insert into test values ('$name', '$id')");
OCIExecute($s, OCI_DEFAULT);
}


else if($HTTP_POST_VARS['view'])
{
// Select Data...
$s = OCIParse($c, "select * from test");
OCIExecute($s, OCI_DEFAULT);

while (OCIFetch($s))
{
echo "Name = " . ociresult($s, "NAME") .
" , ID = " . ociresult($s, "ID") . "\n";
}
}

// Commit to save changes...
OCICommit($c);

// Logoff from Oracle...
OCILogoff($c);
?>


WHY SUBMIT & VIEW BUTTON IS NOT WORKING ?????

Share this post


Link to post
Share on other sites
Did you say you had a form? If so where is the code for your form, the html not the PHP as your php code looks ok. All I want to see is how your submitting your form.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.