I am trying to insert some data into a MySQL database using MySQLi, I have connected to the database but the page is just blank and the MySQL database is empty. Any ideas?
<?php
$mysqli = new mysqli('localhost', '***', '***', '***');
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
session_start();
$stmt = $mysqli->prepare("INSERT INTO membersinfo VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param('ssssssssssssssssssssssssssssssss', $_SESSION['fullname'], $_SESSION['sex'], $_SESSION['dob'], $_SESSION['nameofparent'], $_SESSION['address1'], $_SESSION['address2'], $_SESSION['city'], $_SESSION['postcode'], $_SESSION['homephone'], $_SESSION['mobilephone'] ,$_SESSION['workphone'], $_SESSION['email'], $_SESSION['email2'], $_SESSION['contactname'], $_SESSION['relation'], $_SESSION['phonenumber'], $_SESSION['med'], $_SESSION['disability'], $_SESSION['typeofdis'], $_SESSION['natureofdis'], $_SESSION['sport'], $_SESSION['wheresport'], $_SESSION['friends'], $_SESSION['sign1'], $_SESSION['con1'], $_SESSION['date1'], $_SESSION['sign2'], $_SESSION['con2'], $_SESSION['date2'],$_POST['sign3'], $_POST['con3'], $_POST['date3']);
/* execute prepared statement */
$stmt->execute();
printf("%d Row inserted.\n", $stmt->affected_rows);
/* close statement and connection */
$stmt->close();
/* close connection */
$mysqli->close();
?>