简体   繁体   中英

Undefined type phpGrid\C_DataBase

I am doing a Purchase Ordering Sale System and currently, I try to generate a barcode for each item where those barcodes will be used to add to the cart once the barcode has been scanned.

So I follow a tutorial from this site Inventory Management System , using the barcode generator library, phpGrid library and phpChart library. I also already configure the conf.php.

The problem is when I type C_DataBase into my code, it says undefined type phpGrid\C_DataBase.

barcodelisting.php

use phpGrid\C_DataBase;

require_once("../../phpGrid/conf.php");


$db = new C_DataBase(PHPGRID_DB_HOSTNAME, PHPGRID_DB_USERNAME, PHPGRID_DB_PASSWORD, 
                      PHPGRID_DB_NAME, PHPGRID_DB_TYPE,PHPGRID_DB_CHARSET);

conf.php

define('PHPGRID_DB_HOSTNAME','localhost'); 
define('PHPGRID_DB_USERNAME', 'root');    
define('PHPGRID_DB_PASSWORD', ''); 
define('PHPGRID_DB_NAME', 'pos');
define('PHPGRID_DB_TYPE', 'mysql'); 
define('PHPGRID_DB_CHARSET','utf8mb4');

// *** You should only define SERVER_ROOT manually when use Apache alias directive or 
 IIS virtual directory ***
define('SERVER_ROOT', str_replace(str_replace('\\', '/', 
realpath($_SERVER['DOCUMENT_ROOT'])),'', str_replace('\\', '/',dirname(__FILE__))));
define('THEME', 'start');
define('FRAMEWORK', '');
define('CDN', true);    
define('DEBUG', false); // *** MUST SET TO FALSE WHEN DEPLOYED IN PRODUCTION ***

The free version doesn't need namespace phpGrid. So use phpGrid\C_DataBase; is probalby not needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM