How can i use the mysql_real_escape_string()
function in my MySQL queries for $_SESSION
variables? This is my code at this moment.
Hope that someone can help me.
Thanks :-)
<input value='<?php echo $_SESSION['reg']['data']['password1']; ?>'
How can i use the mysql_real_escape_string()
function in my MySQL queries for $_SESSION
variables? This is my code at this moment.
Hope that someone can help me.
Thanks :-)
<input value='<?php echo $_SESSION['reg']['data']['password1']; ?>'
See the manual, something like:
<?php
$user = $_SESSION['reg']['data']['user'];
$password = $_SESSION['reg']['data']['password'];
$query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
mysql_real_escape_string($user),
mysql_real_escape_string($password));