Jump to content


Photo

PHP button problem


  • Please log in to reply
1 reply to this topic

#1 austine_power007

austine_power007
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 06 April 2006 - 05:45 AM

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 ?????

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 06 April 2006 - 09:13 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users