I am having an issue adding a result to my database. Here is my code for linking.
$startingunix = strtotime($dates . " " . $startingtime); //
$endingunix = strtotime($dates . " " . $endingtime);
$servername = "localhost";
$username = "x";
$password = "x";
$dbname = "josfei6_ge";
// Create connection
$connection = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$connection) {
die("Connection failed: " . mysqli_connect_error());
}
date_default_timezone_set("America/Los_Angeles");
global $mysqli;
$sql="SELECT * FROM `events` WHERE `description` = '$desc' ORDER BY starttime;";
$records=mysqli_query($connection, $sql);
$numberofevents = 0;
$okay = 0;
while($eventnow=mysqli_fetch_assoc($records)){}
I get the error when I try to add data to the database:
$dbconnection->query($sql);
It gives me an error of:
fatal error: Call to a member function query() on a non-object
Anyone have suggestions?