Despite the fact that my script runs perfectly well on the server, it fails to submit form data into mysql database. Kindly look into this for me. see code below:
<?php>
$dbcnx = mysql_connect("localhost","user_name","password");
if (!$dbcnx){
exit('<p>Unable to connect to the database</p>');
}
If (isset($_POST['submit']))
{
$SchoolName = $_POST['SchoolName'];
$SchoolEmail = $_POST['SchoolEmail'];
$UserName = $_POST['UserName'];
$pscode = $_POST['pscode'];
$sql = mysql_query("INSERT INTO accesscarduse (SchoolName, SchoolEmail, UserName, pscode)
VALUES ('$SchoolName', '$SchoolEmail', '$UserName', '$pscode')");
}
echo "Values successfully submitted to database. Thank you" ;
?>
Is the issue really with the script or with my mysql database table structure?