I'm trying to retrieve some video information from a MySQL database and searching for it via a $_GET["v"]
request and a mysql query "seen below":
$video = $_GET['v'];
$query = "SELECT * FROM vid--data WHERE v = '".htmlspecialchars($video)."'";
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
This is the error I'm getting:
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '--data WHERE v = '5JxC0plA3kz'' at line 1
How is this error possible?