I have the following connection file...
<?php
session_start();
// Create new mysql connection object
$DBConnect = @new mysqli("localhost","root","","Ladle");
?>
which I include in the following script...
<?php ob_start() ?>
<?php session_start() ?>
<?php
//Connects to the database
include("inc_LadleDB.php");
$this->DBConnect = $DBConnect;
// Get the e-mail address entered
$email = $_POST['user_email'];
$sql = $this->DBConnect->mysql_query("SELECT * FROM tblEmployees WHERE fldEmail='".
$email."'") or die(mysql_error());
$Result = mysql_fetch_assoc($sql);
//validate email fo valid maine account
if($Result)
{ ...
I tried running this but got an error of "Using $this when not in object context"; I just need to perform simple queries and don't want to deal with OO PHP but I have no choice now that mysql is deprecated. How can I reference the included connection file to run the SELECT query in this no OO file?