So I'm making an eCommerce website for uni and everything was fine until I actually tried viewing the site in chrome. Essentially I'm generating a table from MySQL stuff back at uni. The problem I'm having is above where the table should be. Excuse the code being a mess. I'm in between adding things.
<?php $command='select * from products' ; $runCommand=m ysqli_query($connection, $command); if (mysqli_num_rows($runCommand)>0){ echo "
<form id=\ "shoppingcart\" action=\ "cart.php\" method=\ "post\">"; echo "
<table>"; echo "
<thead>"; echo "
<tr>"; echo "
<th scope=\ "col\">Image</th>"; echo "
<th scope=\ "col\">Item</th>"; echo "
<th scope=\ "col\">Qty</th>"; echo "
<th scope=\ "col\">UpdatedQty</th>"; echo "
<th scope=\ "col\">Price</th>"; echo "</tr>"; echo "</thead>"; while($ROWVARIABLE= mysqli_fetch_assoc($runCommand)) { //line BROKE goes here //need an if quantity=0 then don't print the bunch we have under here...// echo "
<tr>"; echo "
<td>
<img src='". $ROWVARIABLE["image"]. "' alt='". $ROWVARIABLE["decription"]. "' height='200' '</img></td>"; //this is still one line, don't flip shit. It 's the img with a hover over Decription
echo "<td>". $ROWVARIABLE["name"]. "</td>"; //Item
echo "<td>".newID[$ROWVARIABLE["ID"]]."</td>"; //Quantity
echo "<td><select name=\"updateQ\" id=\"updateQ\">"; //Updated Quantity
echo "<option selected=\"selected\">No change</option>";
echo "<option>1</option>";
echo "<option>2</option>";
echo "<option>3</option>";
echo "<option>4</option>";
echo "<option>5</option>";
echo "<option>6</option>";
echo "<option>7</option>";
echo "<option>8</option>";
echo "<option>9</option>";
echo "</select>";
echo "</td>";
//BROKE 2.0
// Gotta fix this ^^ line to display £Price of all units added(£Price of one unit)
}
echo "</table>";
echo "</br>";
}
else{
echo "Table broken, pls stahp!";
}
?>
If you run the code snippit it throws a bunch of echos above the table and I have no idea why or how to fix it. I guess this is probably a rookie error but I'm really panicking. The file is saved as .php and I start the file with <!DOCTYPE html>. This is near the top of my file
<?php $connection = mysqli_connect(the stuff I need to connect.); ?>
Thought that is relevant.