insert query problem
Posted: Tue Sep 13, 2011 5:56 am
plz help me out in this query
Code: Select all
<?php
$a = $_POST['T1'];
$b = $_POST['T2'];
$c = $_POST['T3'];
$d = $_POST['T4'];
$e = $_POST['T5'];
$f = $_POST['T6'];
$con = mysql_connect("localhost", "root", "");
if(!$con)
{
echo "error in connection".mysql_error();
}
mysql_select_db("uc", $con);
$q = mysql_query("insert into members values('$a',$b','$c','$d','$e','$f'",$con);
if(!$q)
{
echo "error in query".mysql_error();
}
session_start();
$_SESSION['sname'] = $a;
header("location:confrmreg.php");
}
else
{
echo "invalid id or password try again";
}
?>