Heres what I got:
But it doesnt work i get this error please help:
Fatal error: Call to a member function execute() on a non-object
Code
<?php
require("inc/connection.php");
if ($link->connect_error)
die('Connect Error: '.$link->connect_errno.': '.$link->connect_error);
$insertedcode = $_POST['code'];
//$results = $link->query("SELECT code FROM code WHERE code = :code");
$query_string = "SELECT code FROM code WHERE code = :code";
$query_params = array(
':code' => $_POST['code']
);
$stmt = $link->prepare($query_string);
//$stmt->bind_param('s', $query_params[':code']);
$result = $stmt->execute($query_params);
$row = $stmt->fetch();
if($row) {
$number = mt_rand(0,3999);
echo $number;
}
?>But it doesnt work i get this error please help:
Fatal error: Call to a member function execute() on a non-object


