Well, I'm trying to query with a variable I'm getting, but it's not working. Any suggestions?
$model = $_REQUEST['model'];
$customer = $_REQUEST['customer'];
SELECT * FROM sistema WHERE concluido <> 1 AND site='$site' AND $model='X'
Well, I'm trying to query with a variable I'm getting, but it's not working. Any suggestions?
$model = $_REQUEST['model'];
$customer = $_REQUEST['customer'];
SELECT * FROM sistema WHERE concluido <> 1 AND site='$site' AND $model='X'
Work out as follows:
$model = $_REQUEST['model'];
$customer = $_REQUEST['customer'];
$consulta = "SELECT * FROM sistema WHERE concluido <> 1 AND site = '{$site}' AND {$model} = 'X'";
Do not forget to check if the variables are coming correctly and if the comparison signal is actually <>
, you might want to use = '1'
.