Forum Moderators: coopster
$query_run = mysql_query($query)or die(mysql_error());
If($query_run)
{ do something }
//echo the $user_id and the $query_num_rows to make sure they are being set.
$user_id = mysql_result($query,0);//no need to specify the 'id' as you already did that in the query.
echo $user_id;//if it's empty, something above that line is broken.
echo 'User id: '.$user_id;
// my function
function MyCustomizedFunction($string){
$string = substr($string,0,40); // cut the number of characters
$string = strip_tags($string); // get rid of html,php code that may be malicious
$string = htmlentities($string); // convert symbols that may be malicious
$string = htmlentities($string,ENT_QUOTES);
$string = mysql_real_escape_string($string);
return $string;
}
// here i use the function that i have built
$password = MyCustomizedFunction($_POST['password']);
[edited by: eelixduppy at 12:50 pm (utc) on Apr 20, 2012]
[edit reason] fixed side scroll [/edit]