AdamHull12 Posted November 24, 2014 Share Posted November 24, 2014 Hello, I have this code <?php $stmt = $db->prepare("INSERT INTO `members` (`playername`,`player_login_name`,`player_login_pass`,`my_email`, `my_gender`,`signup_IP`,`signup_time`) VALUES(?,?,?,?,?,?,?)"); $stmt->bind_param("ssssssi",$_POST['email'],$_POST['email'],md5($_POST['pass']),$_POST['email'],$_POST['gender'],$_POST['REMOTE_ADDR'],time()); $stmt->execute(); $stmt->close(); ?> and i will not insert into my database. I have check the syntax and there is no error, can anyore help me thanks Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/ Share on other sites More sharing options...
Barand Posted November 24, 2014 Share Posted November 24, 2014 What does $stmt->error tell you? Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497502 Share on other sites More sharing options...
AdamHull12 Posted November 24, 2014 Author Share Posted November 24, 2014 What does $stmt->error tell you? Column 'signup_IP' cannot be null but it is defined by the $_POST['REMOTE_ADDR'] Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497503 Share on other sites More sharing options...
Barand Posted November 24, 2014 Share Posted November 24, 2014 echo '<pre>', print_r($_POST, 1), '</pre>'; what does that give? Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497504 Share on other sites More sharing options...
AdamHull12 Posted November 24, 2014 Author Share Posted November 24, 2014 I have fixed i just realised i declared it as post and not server Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497505 Share on other sites More sharing options...
Barand Posted November 24, 2014 Share Posted November 24, 2014 That was going to be my next post, but i thought I should take you through the debugging steps. Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497506 Share on other sites More sharing options...
AdamHull12 Posted November 24, 2014 Author Share Posted November 24, 2014 Thanks for your help Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.