cyimking Posted March 11, 2012 Share Posted March 11, 2012 Ok, so im not sure if this been answered or address yet, but when i go to register a user into my database, i get an error about my bio not having a default value? When the user register they only have to enter their email, username, and password. My "bio" is a text type, and when i go to the users that i already have register and edit the bio part (in a edit_profile.php file, using the update function), it works fine. I also notice that this only occurs when the selected columns are text/blog types. Quote Link to comment Share on other sites More sharing options...
cyimking Posted March 11, 2012 Author Share Posted March 11, 2012 Mysql Version : 5.5 Code for my registration (the main part, where error is located) $sql = mysql_query("INSERT INTO members (username, email , password, join_date) VALUES ('$username','$email','$protect_password', now())") or die (mysql_error()); Error Im receiving: "Field 'bio' doesn't have a default value". Again: 'bio' is a text type field, which can not have a default value. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 11, 2012 Share Posted March 11, 2012 It sounds like you're in SQL strict mode. What does this query show you when you execute it in phpMyAdmin or from the mysql command line? SELECT @@SESSION.sql_mode Quote Link to comment Share on other sites More sharing options...
cyimking Posted March 11, 2012 Author Share Posted March 11, 2012 Thanks for the reply "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" in phpmyadmin. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 11, 2012 Share Posted March 11, 2012 Yup, that's the problem. Is it your server, or hosted? Quote Link to comment Share on other sites More sharing options...
cyimking Posted March 11, 2012 Author Share Posted March 11, 2012 I fixed the issue, my MySQL was in strict mode i guess... I had to change it doing this. sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" Quote Link to comment 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.