I have the following code in a PHP file:
<?php if($debug == 1){ ?>
<button id="btn-debug" class="btn btn-default"><i class="fa fa-bug"></i></button>
<?php } ?>
The variable debug
is called here in another file:
$debug = data_setting_value($dbc, 'debug-status');
The data_setting_value
function is contained in another file, this function will fetch a table in the database from the value of the field value
, which in this case is 1
function data_setting_value($dbc, $id){
$q = "SELECT * FROM settings WHERE id = '$id'";
$r = mysqli_query($dbc, $q);
$data = mysqli_fetch_assoc($r);
return $data['value'];
}
The problem is that the button is not appearing on the page, and you should have seen that the value field in the database is 1