The following is my test.php page which gets redirected from registration.php page.
everything over here works very fine except sql query. All the alert tags show session variable values perfectly well, but this page gives 'Error, insert query failed' error.
Tried all possibilities like quotes to variables in query, etc., But nothing is working.. Please someone help..

```
<?php
include "connect.php";
session_start();

$ser= $_SESSION['service'];
$comp=$_SESSION['comp'];
$yr= $_SESSION['year'];
$addr= $_SESSION['addr'];
$per= $_SESSION['per'];
$no= $_SESSION['no'];
$email= $_SESSION['email'];
$uname= $_SESSION['uname']; 
  echo "<script>alert('$ser')</script>";
  echo "<script>alert('$comp')</script>";
  echo "<script>alert('$yr')</script>";
  echo "<script>alert('$no')</script>";
  echo "<script>alert('$addr')</script>";
if($ser=='designing'){
   $ser=1;
}else if($ser=='webdev'){
   $ser=2;
}else{
   $ser=3;
}
echo "<script>alert('$ser')</script>";
$sql= "insert into login values 
      ('$uname','xxxx',$ser,'$comp',$yr,'$addr','$per',$no,'$email')";
mysql_query($sql) or die('Error, insert query failed');
?>

<span style="font-family:Tahoma; font-weight:bold; font-size:11px;color:#666666" 
      align=center>Your Registration is successful...<br/>Our team will contact you at
      the earliest...
</span>

```