Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Fatal error: Call to a member function bind_param()
    text
    copied!<p>I've gone over this script like 30 times, and I can't for the life of me find my problem. Here is the code:</p> <pre><code>function redeem() { $case = $_POST["case"]; $name = $_POST["name"]; $profession = $_POST["profession"]; $city = $_POST["city"]; $country = $_POST["country"]; $totalpercent = $_POST["totalpercent"]; $pretest = $_POST["pretest"]; $posttest = $_POST["posttest"]; $investigationspercent = $_POST["investigationspercent"]; $timesreset = $_POST["timesreset"]; $creditsspent = $_POST["creditsspent"]; $timescompleted = $_POST["timescompleted"]; //Add the information to the learnent_cases_leaderboard table $stmt = $this-&gt;db-&gt;prepare("INSERT INTO learnent_cases_leaderboard (case, name, profession, city, country, totalpercent, pretest, posttest, investigationspercent, creditsspent, timescompleted, timesreset, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)"); $stmt-&gt;bind_param("sssssiiiiiii", $case, $name, $profession, $city, $country, $totalpercent, $pretest, $posttest, $investigationspercent, $creditsspent, $timescompleted, $timesreset); //the quotations specify the type of variable; //See http://php.net/manual/en/mysqli-stmt.bind-param.php for more information on bind_param $stmt-&gt;execute(); $stmt-&gt;close(); </code></pre> <p>When I look at the error log, it gives me this error message:</p> <p>Line 105 is this line: </p> <blockquote> <p>PHP Fatal error: Call to a member function bind_param() on a non-object on line 105</p> </blockquote> <p>Code: </p> <pre><code>$stmt-&gt;bind_param("sssssiiiiiii", $case, $name, $profession, $city, $country, $totalpercent, $pretest, $posttest, $investigationspercent, $creditsspent, $timescompleted, $timesreset); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload