Q: 500 internal server error ONLY if column is not null I am getting a 500 internal server error but only if I have certain MYSQL data columns set as not NULL.   In PHPMyAdmin, if I uncheck the "Null" box, I get the 500 error.  If not, I don't.    I just don't understand why this would be.   Why does it matter if it has a default value of null or not?  The affected values are q1right and q2right.   None of the others seem to be affected.  I have posted the PHP code below:
//set POST data as data to be inserted
$playername = $_POST['playername'];
$playerlastname = $_POST['playerlastname'];
$email = $_POST['email'];
$coursename = $_POST['coursename'];
$period = $_POST['period'];
$quizname = $_POST['quizname'];
$score = $_POST['score'];
$numberofquestions = $_POST['numberofquestions'];
$q1right = $_POST['q1right'];
$q2right = $_POST['q2right'];

// Everything is cool -- Insert the data into the database


$stmt = $dbh->prepare("INSERT INTO $tname (playername,playerlastname,email,coursename,period,quizname,score,numberofquestions,q1right,q2right) VALUES (:playername,:playerlastname,:email,:coursename,:period,:quizname,:score,:numberofquestions,:q1right,:q2right)");

$stmt->execute(array(':playername' => ltrim($playername), ':playerlastname' => ltrim($playerlastname), ':email' => ltrim($email), ':coursename' => $coursename,':period' => $period,':quizname' => $quizname,':score' => $score,':numberofquestions'=> $numberofquestions,':q1right'=> $q1right,':q2right'=> $q2right));
    $affected_rows = $stmt->rowCount();     

// check if row inserted

 /* Return number of rows that were inserted */
 $count = $stmt->rowCount();
 echo ("$count");

Any thoughts on this are appreciated.   For some reason it doesn't insert q1right or q2right into the database either, whether I get the error or not.  I can't see any errors in the code but I'm probably missing something. 
Also, nothing is showing up in my error logs in Cpanel.   Is there code I need to add to make this happen? 
