I'm currently creating an Admin Panel and I'm coding it to be 100% fool proof. You'll be able to edit every piece of information through editing phrases from the database.
The main way I know is to use this:
$c = $conn->query('SELECT phrase FROM phrases WHERE phrase_name = "corp_name"') or trigger_error($conn->error);
$d = $c->fetch_array();
$phrase_corp_name = $d['phrase']; // "Corporation"
This is not very ideal when I'm going to have dozens of phrases.
The issue is, when I try to select a phrase like so, it does nothing:
$phrase_corp_name = mysqli_query($conn, "SELECT phrase FROM phrases WHERE phrase_name = 'corp_name'");
This should ideally output, "Corporation," which is the value of "phrase" in this instance. I'm assuming the code is wrong, but I can't wrap my head around it.
The error I get here is:
Recoverable fatal error: Object of class mysqli_result could not be converted to string in ... on line 94