mysql - How to set column value as variable in msaccess php -
my query :
$att="select attdata.rollno,attdata.name,attdata.year,attdata.sec,attdata.".$date." attdata attdata.sec='".$sec."' , attdata.dept='".$dept."' , attdata.year='".$year."' , attdata".$date."='ab' ";
my database design view
my error
warning: odbc_exec() [function.odbc-exec]: sql error: [microsoft][odbc microsoft access driver] syntax error (missing operator) in query expression 'attdata.sec='a' , attdata.dept='cse' , attdata.year='iv' , attdata'02-07-2016'='ab' ''., sql state 37000 in sqlexecdirect in c:\wamp\www\sms1.7.16\repotdaygen_allyear.php on line 325 select invalid37000
try ...i added square brackets around $date in 2 spots
$att="select attdata.rollno,attdata.name,attdata.year,attdata.sec,attdata.[".$date."] attdata attdata.sec='".$sec."' , attdata.dept='".$dept."' , attdata.year='".$year."' , attdata[".$date."]='ab' ";
Comments
Post a Comment