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,887
  • 3
  • 18
  • 37
Nguyễn Minh Huy
  • 265
  • 4
  • 6
  • 15

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
  • 1,141
  • 1
  • 13
  • 18