php - MySQL - Build a query string -
i've tried of below yet can't seem working
$sql="update filename set weekday = {$_get[wkd]} id = 2"; $sql="update filename set weekday = '$_get[wkd]' id = 2"; $sql="update filename set weekday = '"{$_get[wkd]}"' id = 2"; $sql="update filename set weekday = '."{$_get[wkd]}".' id = 2";
what correct way?
thanks
the proper way? assuming $link
mysqli_connect
$wkd = mysqli_real_escape_string($link, $_get['wkd']); $sql = "update filename set weekday = '" . $wkd . "' id = 2";
Comments
Post a Comment