griimnak
You're a slave to the money then you die
So I'm working on something right now, I've been looking for a solution for quite some time, kinda new to pdo.
So basicaly i have a table here:
and I'm trying to make it so when i maint = 0 there will be a green check on the site (as in, maint = enabled)
but my code is not working, not sure why?
Thanks in the advance, i have no idea what the issue is, i've tried alot of methods *shrugs*
I know it must be something with the query, maybe i'm not supposed to use fetchall
So basicaly i have a table here:
and I'm trying to make it so when i maint = 0 there will be a green check on the site (as in, maint = enabled)
but my code is not working, not sure why?
Code:
<?php
$query = dbConnect()->prepare("SELECT maintenance FROM gweb_settings");
$query->execute();
$res = $query->fetchAll(PDO::FETCH_COLUMN);
if($res == 1){
echo "<li class='security off last'><span class='value on-off'>Low</span>maint";
echo "<div class='tooltip'>";
echo "Maintenance on";
echo "</div></li>";
}else{
echo "<li class='wifi on'><span class='value on-off'>On</span>maint";
echo "<div class='tooltip'>";
echo "Maintenance off";
echo "</div></li>";
}
?>
I know it must be something with the query, maybe i'm not supposed to use fetchall