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 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' 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'])" ); Link to comment https://forums.phpfreaks.com/topic/112844-solved-inserting-into-database/#findComment-579602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.