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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -