0

Anybody help me solve this query, error is syntax error,

unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

 $sl = "select * from sanpham where id='$_GET['id']'";
Rajdeep Paul
  • 16,739
  • 3
  • 17
  • 37
Nguyễn Minh Huy
  • 255
  • 2
  • 6
  • 13

1 Answers1

0

Careful with arrays and keys.

 $sl = "select * from sanpham where id='{$_GET['id']}'";

Or

 $sl = "select * from sanpham where id='" . $_GET['id'] . "'";
Jerry
  • 971
  • 11
  • 17