I have written a page to display vehicles for sale with a picture, year, make, model and price of vehicle. There is no syntax errors in the code and when I run the code It displays nothing. My code is listed below. Please help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Inventory</title> <style> table { font-family:Verdana, Geneva, sans-serif; font-size:12px; font-weight:bold; color:#FFF; } </style> </head> <body background="images/bg-image1.jpg"> <p align="center" style="font-family:Verdana, Geneva, sans-serif; color:#FFF; font-weight:bold"><font size="5">Vehicles for Sale</font><br /><font size="2">(All photos are file photos<br />Photos do not represent actual vehicles)</font></p> <?php include_once('dbconnect.php'); $q = "SELECT * FROM vehicles"; $r = mysqli_query($q); echo "<table align='center' width='990' class='table'> <tr> <th>Picture</th> <th>Year</th> <th>Make</th> <th>Model</th> <th>Price</th> </tr>"; while($row = mysqli_fetch_array($r)){ echo "<tr>"; echo "<td width='203'>"; echo "<img src='data:image/jpeg;base64,".base64_encode($row['image'])."'>"; echo "</td>"; echo "<td>" .$row['year']. "</td>"; echo "<td>" .$row['make']. "</td>"; echo "<td>" .$row['model']. "</td>"; echo "<td>" .$row['price']. "</td>"; echo "</tr>"; echo "</table>"; } ?> </body> </html>
Code from dbconnect.php:
<?php mysqli_connect("localhost", "takisis", "zifnab#666") or die(mysqli_error()); mysqli_select_db("ezwayautos") or die(mysqli_error()); ?>