retriving data from table and i need to insert the retrived data into another table i

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chaithu
    New Member
    • Oct 2013
    • 1

    retriving data from table and i need to insert the retrived data into another table i

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>STUDENT FORM</title> </head> <body bgcolor="#333333"> <?php
    $HTNO=$_POST['HTNO'];
    $RANK=$_POST['RANK'];
    $Name=$_POST['Name'];
    $FName=$_POST['FName'];
    $DOB=$_POST['DOB'];
    $SSC=$_POST['SSC'];
    $Gender=$_POST['Gender'];
    $Caste=$_POST['Caste'];
    $Region=$_POST['Region'];
    $Fee=$_POST['Fee'];
    $db=odbc_connect("masterodbc","sa","chaithu");
    $stmt="INSERT into reglist(HTNO,RANK,Name,FName,DOB,SSC,Gender,Caste,Region,FEE)values('".$_REQUEST['HTNO']."','".$_REQUEST['RANK']."','".$_REQUEST['Name']."','".$_REQUEST['FName']."','".$_REQUEST['DOB']."','".$_REQUEST['SSC']."','".$_REQUEST['Gender']."','".$_REQUEST['Caste']."','".$_REQUEST['Region']."','".$_REQUEST['FEE']."')";
    $result = odbc_do($db,$stmt);
    if($result)	
    {
    	echo "<script language='javascript'>\n";
    	echo "alert('Successfully Inserted');window.location.href='reg.php';";
        echo "</script>\n";
    }
    else
    {
        echo "<script language='javascript'>\n";
    	echo "alert('Not Inserted ');window.location.href='reg.php';";
        echo "</script>\n";
    }
    odbc_close($db);
    ?> </body> </html>
    Last edited by Rabbit; Oct 28 '13, 04:05 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
Working...