简体   繁体   English

未定义类型 phpGrid\C_DataBase

[英]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.所以我按照这个站点库存管理系统的教程,使用条形码生成器库、phpGrid 库和 phpChart 库。 I also already configure the conf.php.我也已经配置了conf.php。

The problem is when I type C_DataBase into my code, it says undefined type phpGrid\C_DataBase.问题是当我在代码中键入 C_DataBase 时,它​​显示未定义类型 phpGrid\C_DataBase。

barcodelisting.php条码列表.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.免费版不需要命名空间 phpGrid。 So use phpGrid\C_DataBase;所以use phpGrid\C_DataBase; is probalby not needed.可能不需要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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