Os i'm starting to use mysqli, i'm getting a little confused with how it works.
So i have a function:
function verify_payment_date()
{
$today = date("Y-m-d");
$email = $_SESSION['email'];
$result = $this->conn->query("SELECT * FROM user WHERE email=$email");
while ($row = $result->fetch_object())
{
$next_payment_date = $row['next_payment_date'];
}
}
To set up my connect i do this in the same class:
private $conn;
function __construct()
{
$this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or
die('There was a problem connecting to the database.');
}
can anyone give me a helping hand here because i'm totally lost. I was basing some of the code on this website: http://www.willfitch.com/mysqli-tutorial.html
Also the error i'm getting is:
Fatal error: Call to a member function fetch() on a non-object in /home/vhosts/tradingeliteclub.com/subdomains/test/httpdocs/FES/members/classes/Mysql.php on line 52
I'm not sure where to go from here.
Thanks for your time and help.