Try this:
$sql = "INSERT INTO survey (sid, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10,)
VALUES (' ', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?')";
You can get each of the question value like below :
$q1 = isset($_POST['q1']) ? $_POST['q1'] : 0;
$q2 = isset($_POST['q2']) ? $_POST['q2'] : 0;
$q3 = isset($_POST['q3']) ? $_POST['q3'] : 0;
$q4 = isset($_POST['q4']) ? $_POST['q4'] : 0;
$q5 = isset($_POST['q5']) ? $_POST['q5'] : 0;
$q6 = isset($_POST['q6']) ? $_POST['q6'] : 0;
$q7 = isset($_POST['q7']) ? $_POST['q7'] : 0;
$q8 = isset($_POST['q8']) ? $_POST['q8'] : 0;
$q9 = isset($_POST['q9']) ? $_POST['q9'] : 0;
$q10 = isset($_POST['q10']) ? $_POST['q10'] : 0;
and then in your PHP code, you can do the following :
$stmt = $conn->prepare("INSERT INTO survey (q1, q2, q3, q4, q5, q6, q7, q8, q9, q10) VALUES ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?')");
$stmt->bind_param("ssssssssss", $q1, $q2, $q3, $q4, $q5, $q6, $q7, $q8, $q9, $q10);
$stmt->execute();
Though I have not tested the above code, but I hope this will help you :). Please write me back if you need any further assistance.
Note: You have mentioned, you are getting error for DB connection, that means you must be getting some error message for
$conn->connect_error. Please paste the error you are getting so that we can further help you accordingly.