Hello
I have completed the videos for the PHP shopping cart with paypal. Everythings was fine. After following the 3 follow on videos for changing from XML to MySql i keep getting "Notice: Trying to get property of non-object in C:\wamp\www\vicki_evans\functions\functions.php on line 24"
<?php
/* DATABASE */
$server = 'localhost';
$db = 've-products';
$mysqli = new mysqli($server, $db);
/* DEFINE GLOBALS */
define('PAYPAL_BUSINESS_VALUE' , 'seller_1309719804_biz@hotmail.com');
define('PAYPAL_FORM_URL','https://www.sandbox.paypal.com/cgi-bin/webscr');
/* DEFINE REFERENCES */
require_once 'templates.php';
require_once '../classes/shoppingcart.php';
//* FUNCTIONS */
session_start();
function get_products()
{
global $mysqli;
$result = $mysqli->query("SELECT * FROM products");
24 if ($result->num_rows > 0) Line 24
{
$row_num = 0;
while ($row = $result->fetch_object())
{
$products[$row_num]['id'] = $row->id;
$products[$row_num]['title'] = $row->title;
$products[$row_num]['description'] = $row->description;
$products[$row_num]['image'] = $row->image;
$products[$row_num]['price'] = number_format($row->price,2);
$row_num++;
}
return $products;
}
else
{
return FALSE;
}
}
I have checked back through the videos and everything seems correct, any suggestions?