I'm trying to create a template that fetches a row of data from a database based on the URL variables ?=1&?b=siteurl
for example. when http://www.example.com/?a=1&?b=siteurl
is visited, I'd like to display all of the information from that specific row, example- the title.
$id = $_GET['a'];
$dp = $_GET['b'];
$stmt = $mysqli->prepare( "select option_id,option_name,option_value from tablename WHERE option_id = ? AND option_name = ?");
$stmt->bind_param("is", $id, $dp );
$stmt->execute();
$result = $stmt->get_result();
if($result->num_rows > 0){
while ($row = $result->fetch_assoc()) {
echo '<span id="show">',"{$row['value']}",'</span>' ;
}
}
}
I think it's working because I don't receive any error, but no data showing up, if I run this query in phpMyAdmin I receive data that I want to get.