AKalair Posted September 16, 2008 Share Posted September 16, 2008 Hi guys, I'm not developing a simple register page but despite saying the data's been added when I check it hasnt? <?php connect data $query = "INSERT INTO users(username) VALUES({$_POST['username']}, 1)"; $result = mysql_query($query); Any ideas Thanks. echo "The data has been added to the database."; ?> Quote Link to comment https://forums.phpfreaks.com/topic/124445-solved-data-not-being-added-to-database/ Share on other sites More sharing options...
ratcateme Posted September 16, 2008 Share Posted September 16, 2008 change $result = mysql_query($query); to $result = mysql_query($query) or die(mysql_error()); also you have said one field but given 2 values Scott. Quote Link to comment https://forums.phpfreaks.com/topic/124445-solved-data-not-being-added-to-database/#findComment-642651 Share on other sites More sharing options...
Garethp Posted September 16, 2008 Share Posted September 16, 2008 $Username = $_POST['username']; $query = "INSERT INTO users(username) VALUES('$Username')"; Quote Link to comment https://forums.phpfreaks.com/topic/124445-solved-data-not-being-added-to-database/#findComment-642659 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.