Hi all,
I'm trying to execute a query which uses the value from my session which is set when the user logs in. When I try to view the query, it displays nothing.
SQL statement
// get value of session
$username = $_SESSION['username'];
// executeable query
$sql = ("SELECT * FROM custstock
WHERE username = '$username'");
// query
$row = mysqli_query($custdb, $sql) or die(mysqli_error($custdb));
The code for my table;
<table width="100%" border="1" cellpadding="1" cellspacing="1" class="carInfo">
<tr>
<th>ID</th>
<th>Vehicle ID</th>
<?php
while($custveh = mysqli_fetch_assoc($row)){
echo "<tr>";
echo "<td>".$custveh['id']."</td>";
echo "<td>".$custveh['vehID']."</td>";
echo "</tr>";
}
?>
</table>
Any suggestions would be great, thanks!
Jack