I am writing a php script to query a MYSQL database. However, I may have a syntax error that makes my code not work.
If I do not use a variable and subsitute $errType for 'version'(for example), everything works fine. I am having issues with using a variable in place for a field.
$errType = $_POST['errorCategory'];
$errType = $mysqli->real_escape_string($errType);
$sql = "SELECT * FROM codecError WHERE '$errType' ='0' ";
$result = $mysqli -> query($sql);
$count = $result -> num_rows;
if($count > 0){
}