So I’m trying to find out the most effective way to write my website project and am failing pretty miserably with one part. I would like to somehow echo a variable within my echo statement. This is what I have right now:
<header>
<?php
require_once 'header.php';
$sql = "SELECT * FROM campsites";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$siteid = $row['site_id'];
$length = $row['length'];
$width = $row['width'];
$fire= $row['fire'];
$water = $row['water'];
$shelter = $row['shelter'];
?>
</header>
<?php
if (isset($_SESSION["u_uid"])) {
echo'
<!--Modal1-->
<form action ="includes/reserve.inc.php" method="POST">
<div id="openModal1" class="modalDialog">
<div>
<a href="#close" title="Close" class="close">X</a>
<h2>Reserve this Campsite!</h2>
<fieldset>
<li><label for="name">Username: </label><input type="text" name="username" id="name" placeholder="Logged In!" disabled></li>
<li><label for="fire">Fire Pit: </label> ---- this is where I want the $fire variable to be ---- </li>
<li><label for="fire">Overhead Shelter: </label> ---- this is where I want the $shelter variable to be ---- </li>
<li><label for="fire">Sewage Hookup: </label> ---- this is where I want the $water variable to be ---- </li>
<li><label for="start">Start Date: </label><input id="startdate1" /></li>
<li><label for="end">End Date: </label><input id="enddate1" /></li>
<li><button type="submit" class="button_2" name="submit">Reserve</button></li>
</div>
</form>
</div>
My fire/water/shelter variables are all boolean. What I would like to put inside my < li > for each variable is something along the lines of : echo “if ($fire = 1) {echo “Yes”;} else {echo “No”;}” but I have no idea how to do this effectively. Does anybody here have any ideas?