Echo MySQLi Inside HTML (Join Function)


I have (some how) managed to build a MySQLi join query. However I cant figure out how to echo the resuls inside HTML.

I have echoed $long_name and $name here

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\
", mysqli_connect_error());

$room = mysql_real_escape_string($_GET['room']);

echo $room;

$query = "SELECT long_name, name
									FROM furniture_groups a
									INNER JOIN productdbase b
									ON = b.product_id
									WHERE `room` = '$room'  LIMIT 15
					if ($result = $mysqli->query($query)) {
 while ($row = $result->fetch_assoc()) {
        printf ("%s (%s)\
", $row["long_name"], $row["name"]);


But I would to echo it here inside the HTML.

<div class="productrangeborder">
<div class="productsdetailsborder">
<a href="<?php echo $query_row['long_name']; ?>" class='productlink' rel="nofollow" ><?php echo $query_row['name']; ?>





wrap your html inside of the while loop and leave out the php part where you have the while and printf lines.