I thought my code was preventing SQL injections, but upon looking on the internet, I realized I was wrong. I was grabbing ID's by using:
$id = mysqli_real_escape_string($_GET['id']);
I learned on the internet that using the MySQL real escape string does not actually prevent me from SQL injection. However, even when I try to use it on my server, it gives me this error:
expects exactly 2 parameters, 1 given - Line: 4
I'm not sure why I was able to use it in a testing environment (wamp), but not on here. I was wondering, what is the correct way to grab IDs and prevent SQL injection?