I created the following script in procedural mysqli because I am just starting from the old mysql. I am not sure about the kinds of quotes around the query to prevent injections. Some users post examples with '
others with "
, so now I'm confused. Can I get injected or attacked with the following code and what are the correct kinds of quotes?
$username = mysqli_real_escape_string($database,$_POST['form_user']);
$password = mysqli_real_escape_string($database,$_POST['form_password']);
$members = "SELECT * FROM `accounts` WHERE `member` = '$username'";
$result = mysqli_query($database,$members);
I am just a beginner so object oriented or PDO or prepared statements are difficult for me at this moment so I just need to improve this script and make it safer but with so many examples and symbols around query vars I am confused about what is and is not safe.