$f_name="Tom";
$select_user="SELECT * from users where f_name=$f_name";
The code above does not work but when I run the code below it works perfectly when not stored in a variable.
My problem is that I need to store the first name in a variable before using it.
$select_user="SELECT * from users where f_name='Tom'";
I tried the code below and expected it to select tom but it returns nothing
$f_name="Tom";
$select_user="SELECT * from users where f_name=$f_name";