Stickybomb Posted October 10, 2007 Share Posted October 10, 2007 i am getting an error when trying to add a user to my database the error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource this is the call for the statment: $db->query('INSERT INTO users (user_pass, user_name, user_lvl, user_email, user_timestamp, user_sid, user_ip) VALUES ("'.$pass.'","'.$user.'","1",,"'.$email.'","'.$time.'","'.$sid.'","'.$ip.'")'); i do not see whats causeing the poblem Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/ Share on other sites More sharing options...
~n[EO]n~ Posted October 10, 2007 Share Posted October 10, 2007 Try this $db->query('INSERT INTO users VALUES ("'.$pass.'","'.$user.'",1,"'.$email.'","'.$time.'","'.$sid.'","'.$ip.'")'); Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-366328 Share on other sites More sharing options...
Stickybomb Posted October 10, 2007 Author Share Posted October 10, 2007 hmm nope same error Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-366333 Share on other sites More sharing options...
otuatail Posted October 10, 2007 Share Posted October 10, 2007 Dont know what the dots are but insert into users values($pass , $user , $email , $sid , $ip) is all thats needed Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-366358 Share on other sites More sharing options...
fenway Posted October 10, 2007 Share Posted October 10, 2007 Dont know what the dots are but insert into users values($pass , $user , $email , $sid , $ip) is all thats needed Not true -- NEVER omit the column names. Echo the interpolated string. Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-366361 Share on other sites More sharing options...
Stickybomb Posted October 10, 2007 Author Share Posted October 10, 2007 I never intended to omit the columns, I just want to know why i get this error any thoughts or suggestions Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-366366 Share on other sites More sharing options...
BYGino Posted October 11, 2007 Share Posted October 11, 2007 Don't know if it will make much difference but you're first code has a double comma between your user_level and email strings. Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-367268 Share on other sites More sharing options...
Stickybomb Posted October 11, 2007 Author Share Posted October 11, 2007 already got it working but thanks Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-367270 Share on other sites More sharing options...
fenway Posted October 11, 2007 Share Posted October 11, 2007 already got it working but thanks How? Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-367374 Share on other sites More sharing options...
Stickybomb Posted October 12, 2007 Author Share Posted October 12, 2007 there was a spelling error in my statement Link to comment https://forums.phpfreaks.com/topic/72655-solved-warning-mysql_query/#findComment-367806 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.