I am trying to store image and other data into MySQL using php. But other data get inserted successfully but only the image column is blank every time. I can't understand the reason behind this. This is my php code which i am using to insert data into table.
function signup($fname, $lname, $nick, $phn, $email, $pass){
require_once 'login.php';
$conn = new mysqli($DBhost, $DBuser, $DBpassword, $DBdatabase);
$query = $conn->prepare('INSERT INTO USERS(FNAME,LNAME,NICK,PHN,EMAIL,PASS,PHOTO) VALUES(?,?,?,?,?,?,?)');
$query->bind_param('sssissb', $fname, $lname, $nick, $phn, $email, $pass, file_get_contents($_FILES['photo']['tmp_name']) );
$query->execute();
printf("%d Row inserted.\n", $query->affected_rows);
$query->close();
$conn->close();
}