Fsoft Posted April 3, 2009 Share Posted April 3, 2009 Hello, I am trying to run this query : mysql_query("INSERT INTO accounts (username,password) values ('love','love');"); To insert this entry in the database but unfortinatelly it is not working Please help me, what is the problem with this line? I already have the database connection and mysql_select_db working .. ! FAISAL! Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/ Share on other sites More sharing options...
Maq Posted April 3, 2009 Share Posted April 3, 2009 No ';' mysql_query("INSERT INTO accounts (username,password) values ('love','love')"); Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800656 Share on other sites More sharing options...
Fsoft Posted April 3, 2009 Author Share Posted April 3, 2009 No ';' mysql_query("INSERT INTO accounts (username,password) values ('love','love')"); Still not working boss :( FAISAL ! Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800659 Share on other sites More sharing options...
Maq Posted April 3, 2009 Share Posted April 3, 2009 This will output a descriptive error. mysql_query("INSERT INTO accounts (username,password) values ('love','love')") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800671 Share on other sites More sharing options...
fenway Posted April 3, 2009 Share Posted April 3, 2009 password is a reserved keyword, isn't it? Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800672 Share on other sites More sharing options...
Fsoft Posted April 3, 2009 Author Share Posted April 3, 2009 Thanks guys, adding a die(); helped me !! FAISAL ! Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800684 Share on other sites More sharing options...
Maq Posted April 3, 2009 Share Posted April 3, 2009 password is a reserved keyword, isn't it? Nope, not on the list. Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800689 Share on other sites More sharing options...
fenway Posted April 3, 2009 Share Posted April 3, 2009 password is a reserved keyword, isn't it? Nope, not on the list. Right, it's a function, that's it. Quote Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800700 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.