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 Quote 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? Quote 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'] Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497504 Share on other sites More sharing options...
Solution AdamHull12 Posted November 24, 2014 Author Solution Share Posted November 24, 2014 I have fixed i just realised i declared it as post and not server Quote 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. Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/292682-mysqli-prepare-not-inserting/#findComment-1497507 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.