在SQL查询中传递密码值? [关闭]

How do we pass passwords in a PHP in the QUERY.

I am trying something like this, but i get a syntax error.

$query = "INSERT INTO users (name, username, email, password) VALUES ('".$_REQUEST['fullname']."','".$_REQUEST['userid']."','"$_REQUEST['mailid']."','".$_REQUEST['userpassword']."')";

There is some error in the above code, which i am unable to figure out. I believe, the password can not be sent simply like this.

Here is the Error:

Parse error: syntax error, unexpected '$_REQUEST' (T_VARIABLE)

Error in:

'"$_REQUEST['mailid']

change on

'" . $_REQUEST['mailid']

And

  1. Better way to use prepared statements for insert data received from user to the database;
  2. Use md5() PHP function for store password, don't store it without encoding in real form;