Jump to content
Stef's Coding Community

chamari

New Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by chamari


  1. In the categories php I am getting the following error. I checked the syntax with the finished file and its correct.

     
    				( ! ) Fatal error: Call to a member function prepare() on a non-object in C:\wamp\www\source\phpcartoopmvc-empty-projectfiles\app\models\m_categories.php on line 35						Call Stack						#							Time							Memory							Function							Location						1							0.0006							669736							{main}( )							..\index.php:0						2							0.0039							727112							Categories->get_categories( )							..\index.php:4
     
    
    
    				( ! ) Fatal error: Call to a member function query() on a non-object in C:\wamp\www\source\phpcartoopmvc-empty-projectfiles\app\models\m_categories.php on line 54						Call Stack						#							Time							Memory							Function							Location						1							0.0007							669616							{main}( )							..\index.php:0						2							0.0160							726936							Categories->get_categories( )							..\index.php:4
     
    It is the same whether I pass a category or not. I think its not connecting to the database.
    Connection script in the init.php
    
    
    //Connect to database
    $server = 'localhost';
    $user = 'root';
    $pass = '';
    $db = 'ks_shop';
    $Database = new mysqli($server, $user, $pass, $db);
    
    
    Please help

     

×
×
  • Create New...