mysqli from mysql

How could I convert this to mysqli? Thanks.

<?php session_start(); include ("../mylibrary/login.php"); login(); $userid = $_POST['userid']; $password = $_POST['password']; $query = "SELECT userid, name from admins where userid = '$userid' and password = ('$password')"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { echo "

Sorry, your account was not validated.


\n"; echo "Try again
\n"; } else { $_SESSION['store_admin'] = $userid; header("Location: smalladmin.php"); } ?>

http://php.net/manual/en/mysqli.prepare.php

I would suggest using object oriented

Sponsor our Newsletter | Privacy Policy | Terms of Service