Any idea why these errors are showing? Connection works fine…
this is the code:
[php]
<?php include ("connectionlink.php"); //connection errors if any... if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $userid = $_POST['userid']; $password = $_POST['password']; /* create a prepared statement */ if ($stmt = $mysqli->prepare("SELECT userid, password FROM admins WHERE userid=? and password=?")) { // bind parameters-define them... $stmt->bind_param("s", $userid); $stmt->bind_param("s", $password); //execute... $stmt->execute(); // bind result variables $stmt->bind_result($userid); $stmt->bind_result($password); //fetch value $stmt->fetch(); printf("%s is equal to %s\n", $userid, $password); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?>[/php]errors are:
PHP Warning: mysqli::prepare() [mysqli.prepare]: Couldn’t fetch mysqli on line 18
PHP Warning: mysqli::close() [mysqli.close]: Couldn’t fetch mysqli on line 41