Jump to content

Query Problem


Tom10

Recommended Posts

Hi, i am sending a query to my database, to check if my website is under maintainance, it's ment to display an access denied page if maintainance in the table is equal to 1 but it's not working properly.

 

Here is the code: 

<?php

error_reporting(E_ALL | E_NOTICE);

require 'connect.php';

session_start();

$pageMaintain = "SELECT maintainance FROM config";

$result = mysqli_query($con, $pageMaintain);

if(mysqli_num_rows($result) == 1) {

include 'accessdenied.php';

die();

} else {



}

?>

And a picture of the table: 

0de933fb29ee5c46e51170a1a4b935cf.png

It doesn't matter if it's 0 or 1 it still includes the access denied page.

Link to comment
https://forums.phpfreaks.com/topic/294756-query-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.