sfx81 Posted July 1, 2008 Share Posted July 1, 2008 Hi can some one please tell me whats wrong with this line. mysql_query ("Insert into userinfo(username,email,password,location) values ( $_REQUEST['userid'] , $_REQUEST['email'], $_REQUEST['password'], $_REQUEST['location'])" ); Cheers Quote Link to comment https://forums.phpfreaks.com/topic/112844-solved-inserting-into-database/ Share on other sites More sharing options...
.josh Posted July 1, 2008 Share Posted July 1, 2008 You mean other than the fact that you're begging for someone to hack your site? mysql_query ("Insert into userinfo(username,email,password,location) values ( '{$_REQUEST['userid']}' , '{$_REQUEST['email']'}, '{$_REQUEST['password']'}, '{$_REQUEST['location']}')"); also your first var in the values list is 'userid' i suspect you meant 'username' Quote Link to comment https://forums.phpfreaks.com/topic/112844-solved-inserting-into-database/#findComment-579600 Share on other sites More sharing options...
papaface Posted July 1, 2008 Share Posted July 1, 2008 Try: If you're using $_POST vars use: mysql_query ("Insert into `userinfo` (`username`,`email`,`password`,`location`) VALUES ( $_POST['userid'] , $_POST['email'], $_POST['password'], $_POST['location'])" ); If you're using $_GET vars use: mysql_query ("Insert into `userinfo` (`username`,`email`,`password`,`location`) VALUES ( $_GET['userid'] , $_GET['email'], $_GET['password'], $_GET['location'])" ); Quote Link to comment https://forums.phpfreaks.com/topic/112844-solved-inserting-into-database/#findComment-579602 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.