If I execute my PHP code:
$serName = $_GET['username'];
// Code for sanitation here
// [...]
$sql = "SELECT NAME FROM PLAYERS WHERE NAME LIKE '%$serName%'";
I get division error, how do I use a variable in a query with wildcards on both sides?
If I execute my PHP code:
$serName = $_GET['username'];
// Code for sanitation here
// [...]
$sql = "SELECT NAME FROM PLAYERS WHERE NAME LIKE '%$serName%'";
I get division error, how do I use a variable in a query with wildcards on both sides?
right query
SELECT NAME FROM PLAYERS WHERE NAME LIKE '%{$serName}%'
And you should use prepared statements