I have created a table everything works fine expect when I try to use a if statement in mine table. Im not too sure how can I fix that tried some research but unable to find answer. echoing an object by itself works but if there is a statement or some kind of condition for some reason the table doesnt like it.
if(!mysqli_query($dbConn,$sql))
{
echo 'Not Inserted';
}
else {
echo "
<table class='table'>
<tr>
<th>Name:</th>
<th>$forename</th>
</tr>
<tr>
<th>Surname:</th>
<th>$surname</th>
</tr>
<tr>
<th>Your email:</th>
<th>$email</th>
</tr>
<tr>
<th>Your Landline number:</th>
<th>$landLineTelNo</th>
</tr>
<tr>
<th>Your Mobile number:</th>
<th>$mobileTelNo</th>
</tr>
<tr>
<th>Your address:</th>
<th>join(', ',$Address)</th> <----------- issue
</tr>
<tr>
<th>Your preferred method of contact:</th>
<th>$sendMethod</th>
</tr>
<tr>
<th>Your category chosen:</th>
<th>
if($catID == \"c1\"){ <------------ issue
echo \"Bed and Breakfast\";
}
elseif ($catID == \"c2\"){
echo \"Craft Shop\";
}
elseif ($catID == \"c3\"){
echo \"Post Office\";
}
elseif ($catID == \"c4\"){
echo \"Tearoom\";
}
elseif ($catID == \"c5\"){
echo \"Village Store\";
}
elseif ($catID == \"null\"){
echo \"No Category chosen\";
} <------------ issue
</th>
</tr>
";
Thank you