im writing a register page using html,php and javascript. i have written the following code
<?php
$db = mysqli_connect('localhost','root','','private_message');
if(isset($_POST['user'])){
$usrname=(string)$_POST['user'];
echo gettype($usrname);
$r=mysqli_query($db ,"select * from users where 'user_name'='$usrname' ") or die("error");
$rows=mysqli_num_rows($r);
echo "";
echo $rows;
}
?>
now my table has user name 'hello' but the above $usrname is not recognised in the part 'user_name'='$usrname' part. what do i do?