Checking if Table Exists & Printing Information
-
I am writing a plugin for someone (already finished really), but they want to be able to see if the DB table for the information exists within the settings page that has been made.
I can’t for the life of me work this one out, and thought I should ask instead of spending another day blindly stabbing in the dark and hoping I get something.
The first issue I came across was when trying to build a multi-string echo statement:
echo "<h3>Database Status:</h3>" + "<h3 style='color: green;'> Online</h3>";
Upon doing this, in the settings page the entire line is replaced with a 0.
Not sure why this is, I think I have laid it out correctly, but the problem is I am a C# developer and am only just moving into PHP and the syntax seems very different ??
What I think I want to do is split the echo so there is an if statement checking if the database exists, then placing in either “Online” in green if it is, and “Offline” in red if it isn’t, but nothing I try or find online seems to help with checking the table.
- The topic ‘Checking if Table Exists & Printing Information’ is closed to new replies.