mysql - Syntax error when use query in php -
this question has answer here:
- php parse/syntax errors; , how solve them? 11 answers
 
anybody me solve query, error syntax error,
unexpected '' (t_encapsed_and_whitespace), expecting identifier (t_string) or variable (t_variable) or number (t_num_string)
 $sl = "select * sanpham id='$_get['id']'";      
careful arrays , keys.
 $sl = "select * sanpham id='{$_get['id']}'";   or
 $sl = "select * sanpham id='" . $_get['id'] . "'";      
Comments
Post a Comment