You mustn't use parentheses at the beginning and at the end, try using this query please:
$sql = "
INSERT INTO
as_registration (roll, registrationid, fullname, username, password, dob, courseid, email, gender, phoneno, status )
VALUES
('". mysql_real_escape_string($roll) ."','". mysql_real_escape_string($regid) ."','"
. mysql_real_escape_string($name) ."','". mysql_real_escape_string($username) ."','"
. mysql_real_escape_string($pwd) ."','". mysql_real_escape_string($dob) ."',"
. mysql_real_escape_string(intval($c_id['courseid'])) .",'". mysql_real_escape_string($email) ."','"
. mysql_real_escape_string($gender) ."','". mysql_real_escape_string($phone) ."','". mysql_real_escape_string($status) ."')";
If you use your code just like this then it's vulnerable for SQL Injection. I would strongly recommend using mysql_real_escape_string as you insert data into your database to prevent SQL injections, as a quick solution or better use PDO or MySQLi.
Besides if you use mysql_*
to connect to your database, then I'd recommend reading the PHP manual chapter on the mysql_*
functions,
where they point out, that this extension is not recommended for writing new code. Instead, they say, you should use either the MySQLi or PDO_MySQL extension.