PHP 'INSERT' into MySQL

I have problem. Please see the code below; remarked in bold; can someone please help point out the mistake and solution?

            $PName = $_POST['PName'];
            $Address = $_POST['Address'];
            $Email = $_POST['Email'];
            $Phone = $_POST['Phone'];
            $CoName = $_POST['CoName'];
            $Category = $_POST['Category'];
            $SDate = $_POST['SDate'];
            $EDate = $_POST['EDate'];
            $Paid = $_POST['Paid'];
            $Free = $_POST['Free'];
            $Show = $_POST['Show'];
    $connection = mysql_connect( $server, $username, $password ) or die("Unable to connect to the database");
    $db = mysql_select_db( $dbname, $connection );

$sql = “INSERT INTO main ( PName, Address, Phone, CoName, Category, SDate, EDate, Paid, Free, Email ) VALUES( ‘$PName’, ‘$Address’, ‘$Phone’, ‘$CoName’, ‘$Category’, ‘$SDate’, ‘$EDate’, ‘$Paid’, ‘$Free’, ‘$Email’ )”;
// The above $sql statement is working

$sql = “INSERT INTO main ( PName, Address, Phone, CoName, Category, SDate, EDate, Paid, Free, Show, Email ) VALUES( ‘$PName’, ‘$Address’, ‘$Phone’, ‘$CoName’, ‘$Category’, ‘$SDate’, ‘$EDate’, ‘$Paid’, ‘$Free’, ‘$Show’, ‘$Email’ )”;
// The above $sql statement is NOT working

$result = mysql_query( $sql, $connection ) or die( “Unable to execute sql statement at line 42”);

What is the type of table field Show? If it is numeric, you need to eliminate single quotes surrounding corresponding value $Show.

Sponsor our Newsletter | Privacy Policy | Terms of Service