Page 1 of 1

class 'mysqli' not found

PostPosted: 21. April 2015 02:26
by fun2shh
Hello i am learning php and working on php Designer 8 while doing a practical i have got an error can you please help me. I have already googled this but did not found anything as my requirement. i have latest version of XAMPP installed.
the error is -
Fatal error: Class 'mysqli' not found in C:\xampp\htdocs\query.php on line 3
PHP Fatal error: Class 'mysqli' not found in C:\xamp\htdocs\query.php on line 3

Also when i open this in browser it shows

Warning: mysqli::mysqli(): (HY000/1045): Access dinied for user 'publications'@'localhost' (using password: YES) in C:\xampp\htdocs\query.php on line 3
Access denied for user 'publications'@'localhost' (using password: YES)

Re: class 'mysqli' not found

PostPosted: 21. April 2015 05:39
by Altrea
Hi,

I cannot believe this error matches for two reasons

1. You have at least One typo in that message, One speaking of a folder c:/xampp the other of c:/xamp. Maybe you got a typo in your code too which belongs to mysqli

2. In your PhpMyAdmin message is mysqli speaking, so it must definetly be running. Your phpMyAdmin issue is just a matter of missing priviledges or missing User.

Best wishes,
Altrea

Re: class 'mysqli' not found

PostPosted: 21. April 2015 10:48
by Nobbie
fun2shh wrote:Fatal error: Class 'mysqli' not found in C:\xampp\htdocs\query.php on line 3
PHP Fatal error: Class 'mysqli' not found in C:\xamp\htdocs\query.php on line 3


The Php Designer 8 is a standalone PHP development tool, it does not rely on Xampp, neither works with Xampp. This message means, that there is missing the mysqli-Extension in your Php Designer 8, you have to ask there how to activate it. But in my mind, it is not a good idea to use two different development environments, as Xampp also comes with a PHP version (what is different to Php Designer 8).

fun2shh wrote:Also when i open this in browser it shows

Warning: mysqli::mysqli(): (HY000/1045): Access dinied for user 'publications'@'localhost' (using password: YES) in C:\xampp\htdocs\query.php on line 3
Access denied for user 'publications'@'localhost' (using password: YES)


When you open your file in a browser, the Xampp PHP Version is active (this is completely different from PHP Designer 8). The mysqli-Extension is activated and known, but in your code you are a doing a connect to MySQL and you provide an unknown UseriD ("publications"). The MySQL Version of Xampp comes with only one valid User, it is called "root" without password and it has all privilidges. You either have to change your PHP code and apply a valid User in line 3, or you have to start PhpMyadmin and create a new User "publications" and provide the password, as it is given in your query.php. That code is probably a demo from a different installation and it may also fail to find a certain database. You have to establish a working database environment, before you can execute that script.

Re: class 'mysqli' not found

PostPosted: 22. April 2015 09:44
by fun2shh
Thank you, Now it is ok.