I'm new to PHP .. I get stuck on how to transfer my sql statement to prepared statement .. The error message that I got is that you " can't connect " ..
My code is as the following
$connection = mysql_connect($host,$username,$password) or die ("can't connect");
$select_database = mysql_select_db($db_name);
$id = mysql_real_escape_string ($_GET ['id']);
$query = 'SELECT * from &tbl_name where id=?';
$stmt = $connection->prepare($query);
$stmt->bind_param("d", $id);
$stmt->execute();
$rows=mysql_fetch_array($stmt);
$stmt->close();