php - functions not showing tables
94
Soo this is giving me errors and idk why, table does exist but still not working, what did i do wrong ?
The content does show but still giving errors and not displaying what it should
function content_temp()
{
if(isset($_GET['action']))
{
if($_GET['action'] == 'banlist')
{
echo " <div class='positiontable'>
<table class='MYTABLE'>
<tr CLASS='MYTABLE'>
<th CLASS='MYTABLE' height=40 width=80>User</th>
<th CLASS='MYTABLE' height=40 width=80>Time</th>
<th CLASS='MYTABLE' height=40 width=180>Reason</th>
<th CLASS='MYTABLE' height=40 width=80>Admin</th>
</tr>
</table>
</div> ";
$query ="SELECT * FROM `Banovi` LIMIT 5";
$row = mysqli_fetch_array($query);
if($row)
$name = $row['Ime'];
$time = $row['Vreme'];
$reason = $row['Razlog'];
$admin = $row['Admin'];
echo " <tr CLASS='MYTABLE'>
<td CLASS='MYTABLE' height=40 width=80>$name</td>
<td CLASS='MYTABLE' height=40 width=80>$time</td>
<td CLASS='MYTABLE' height=40 width=180>$reason</td>
<td CLASS='MYTABLE' height=40 width=80>$admin</td>
</tr>";
}
}
}
Answer
Solution:
UPDATE 2
you might need do some changes:
UPDATE 1
In
content_temp( $con )
, the$con
should be created and passed upon function call: