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! 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')"); 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 ! 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()); 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? 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 ! 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. 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. Link to comment https://forums.phpfreaks.com/topic/152456-solved-mysql_query-error/#findComment-800700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.