Using a variable in a PHP MySQL Query -
i user variable inside of php mysql query represent clause so:
$where= name=mark , address=4; $query= "select * clients $where";
am doing correct? if not, correct so?
your php method correct, need single quotes around string in sql , need wrap string php variable quotes, variable should this:
$where = "name = 'mark' , address = 4"; $query = "select * clients {$where}";
Comments
Post a Comment