Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Access to undeclared static property: DB::$c #3

Open
banna360 opened this issue Sep 13, 2017 · 2 comments
Open

Fatal error: Access to undeclared static property: DB::$c #3

banna360 opened this issue Sep 13, 2017 · 2 comments

Comments

@banna360
Copy link

I am using https://github.com/Xeoncross/DByte this PDO wrapper in my code This site was working fine until last day, Now i can a see an error message in the site which is following.

Fatal error: Access to undeclared static property: DB::$c in 
/home/NAME/public_html/TEST/inc/config.php on line 16

My code with line 16 is

require('DB.php');

$pdo = new PDO(
'mysql:dbname=DBNAME;host=localhost',
'DBUSER',
'MYPASSWORD',
 array(
    PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
 )
 );
 DB::$c = $pdo;
 ?>

What will be the issue in line DB::$c = $pdo; i am with this from the after noon.

@flik
Copy link

flik commented Mar 21, 2018

@banna360 Try this one:

https://github.com/flik/X

@xeoncross
Copy link
Owner

xeoncross commented Mar 21, 2018

@banna360, sorry for the delay, I didn't see your issue. What version of PHP are you using?

$ php -v
> PHP 7.1.7

The following works for me

<?php
require('DByte/DB.php');
$pdo = new PDO('sqlite::memory:');
\DByte\DB::$c = $pdo;

My only guess is that line 17 needs to be changed to mention public or private:

public static $q,$c,$p,$i = '`';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants