class 'mysqli' not found

Problems with the Windows version of XAMPP, questions, comments, and anything related.

class 'mysqli' not found

Postby fun2shh » 21. April 2015 02:26

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)
fun2shh
 
Posts: 2
Joined: 21. April 2015 02:00
Operating System: windows 8.1

Re: class 'mysqli' not found

Postby Altrea » 21. April 2015 05:39

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
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: class 'mysqli' not found

Postby Nobbie » 21. April 2015 10:48

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.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: class 'mysqli' not found

Postby fun2shh » 22. April 2015 09:44

Thank you, Now it is ok.
fun2shh
 
Posts: 2
Joined: 21. April 2015 02:00
Operating System: windows 8.1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 86 guests