Jump to content

Mysql_fetch_array?


MrFish

Recommended Posts

At the beginning of every page I want it to check if I have the site down for maintenance (for future use). If it does then the page loads a "Down for Maintenance" page. If not, it loads regularly. I'm trying to get my script to read what the maintenance field in my system_status table says. It will either say true or false. But when I try and show an alert of the value, it comes up blank.

mysql_select_db("b17_3648160_systemdb", $con);$query= "SELECT * FROM system_status";$run= mysql_query($query);$results = mysql_fetch_array($run);alert($results['maintenance']);

It should show "false". Also, alert is a custom function which works with other text.

Link to comment
Share on other sites

If it's a boolean false value, it might print an empty string instead of the string "false". Use var_dump to check it:var_dump($results['maintenance']);that will tell you both the type and value of the variable.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...