I try to make a selection in SQL using php variables. The code is like this:
$st=$_POST["st"] ;
$tu=$_POST["tu"] ;
$data=$_POST["data"];
$ec= $_POST["ec"] ;
$sql="SELECT nr, '.$ec.' FROM 'report' WHERE st='.$st.' and tu='.$tu.' and dataupdate='.$data.'";
but I get 0 results.
If I change variables from the SQL query with values, it works. Also I test with
echo $st ;
echo $tu ;
echo $data ;
echo $ec ;
and it returns correct value of post. Can anybody tell me what I do wrong ?