473,544 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

not able to find the mysqli.dll

trying to figure out how to use a mysql database with PHP. I ran the
following code:
<?php
// defines database connection data
define('DB_HOST ', 'localhost');
define('DB_USER ', 'ajaxuser');
define('DB_PASS WORD', 'practical');
define('DB_DATA BASE', 'ajax');
// connect to the database
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
// the SQL query to execute
$query = 'SELECT user_id, user_name FROM users';
//execute the query
$result = $mysqli->query($query );
// loop through the results
while ($row = $result->fetch_array(MY SQLI_ASSOC))
{
// extract user id and name
$user_id = $row['user_id'];
$user_name = $row['user_name'];
// do somthing with the data (here we output it)
echo 'Name of user #' . $user_id . ' is ' . $user_name . '<br/>';
}
// close the input stream
$result->close();
// close the database connection
$mysqli->close();
?>

I get the following message suggesting that it can't find the
mysqli.dll file:
"Fatal error: Class 'mysqli' not found in
C:\Apache\htdoc s\ajax\foundati ons\mysql\index .php on line 13"

I have the following in php.ini:
extension=php_m ysqli.dll

I have php_mysqli.dll in php\ext\. I assume that this is where the
class would be implemented. Is that correct?

Any thoughts what the issue might be?

TIA,
David

Oct 23 '06 #1
12 4721
da******@gmail. com wrote:
trying to figure out how to use a mysql database with PHP. I ran the
following code:
<?php
// defines database connection data
define('DB_HOST ', 'localhost');
define('DB_USER ', 'ajaxuser');
define('DB_PASS WORD', 'practical');
define('DB_DATA BASE', 'ajax');
// connect to the database
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
// the SQL query to execute
$query = 'SELECT user_id, user_name FROM users';
//execute the query
$result = $mysqli->query($query );
// loop through the results
while ($row = $result->fetch_array(MY SQLI_ASSOC))
{
// extract user id and name
$user_id = $row['user_id'];
$user_name = $row['user_name'];
// do somthing with the data (here we output it)
echo 'Name of user #' . $user_id . ' is ' . $user_name . '<br/>';
}
// close the input stream
$result->close();
// close the database connection
$mysqli->close();
?>

I get the following message suggesting that it can't find the
mysqli.dll file:
"Fatal error: Class 'mysqli' not found in
C:\Apache\htdoc s\ajax\foundati ons\mysql\index .php on line 13"

I have the following in php.ini:
extension=php_m ysqli.dll

I have php_mysqli.dll in php\ext\. I assume that this is where the
class would be implemented. Is that correct?

Any thoughts what the issue might be?
Did you give readrights to the file for IUSR_<machinena me?

If that does not help, you might have hitted incompatible versions of PHP
with mySQL, eg a very old MySQL or PHP version.
Read more about it here:
http://nl2.php.net/manual/en/ref.mysqli.php

Regards,
Erwin Moller

>
TIA,
David
Oct 23 '06 #2
Did you give readrights to the file for IUSR_<machinena me?
DRS: What is this? How do you do this?
If that does not help, you might have hitted incompatible versions of PHP
with mySQL, eg a very old MySQL or PHP version.
Read more about it here:
DRS: No, they're both very recent versions.

Thanks,
David

Oct 23 '06 #3
I assume that this issue is related to another problem I'm trying to
get some help on. Perhaps it might help identify what's wrong with the
configuration?

Please see
http://groups-beta.google.com/group/...daa12?lnk=raot

Thanks!
=============== =============== ===========

Oct 23 '06 #4
da******@gmail. com wrote:
>Did you give readrights to the file for IUSR_<machinena me?
DRS: What is this? How do you do this?
rightclick the file -select properties
-select security (or whatever W$ named that on your OS)
-check if IUSR_<machinena meis listed there.
If not, add with readrights.

IUSR_<machinena meshould be replaced by the user on your machine.
So if your server has the name blabla2, this user is called IUSR_blabla2.

It works like this: When IIS gets a request for a certain
file/page/whatever, it tries to open it.
For that it need rights to read the file. Makes sense eh?
So last piece of the puzzle: Who is IIS when it open a file? Answer: IIS
runs as user IUSR_<machinena me>

Does that help?
If not come back here.

Regards,
Erwin Moller

>
>If that does not help, you might have hitted incompatible versions of PHP
with mySQL, eg a very old MySQL or PHP version.
Read more about it here:
DRS: No, they're both very recent versions.

Thanks,
David
Oct 23 '06 #5
Sy
$mysqli is a function not a class.
If you want to reuse this function then you need to change the code.

class Mysqli

On Oct 23, 4:18 am, david...@gmail. com wrote:
trying to figure out how to use a mysql database with PHP. I ran the
following code:
<?php
// defines database connection data
define('DB_HOST ', 'localhost');
define('DB_USER ', 'ajaxuser');
define('DB_PASS WORD', 'practical');
define('DB_DATA BASE', 'ajax');
// connect to the database
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
// the SQL query to execute
$query = 'SELECT user_id, user_name FROM users';
//execute the query
$result = $mysqli->query($query );
// loop through the results
while ($row = $result->fetch_array(MY SQLI_ASSOC))
{
// extract user id and name
$user_id = $row['user_id'];
$user_name = $row['user_name'];
// do somthing with the data (here we output it)
echo 'Name of user #' . $user_id . ' is ' . $user_name . '<br/>';
}
// close the input stream
$result->close();
// close the database connection
$mysqli->close();
?>

I get the following message suggesting that it can't find the
mysqli.dll file:
"Fatal error: Class 'mysqli' not found in
C:\Apache\htdoc s\ajax\foundati ons\mysql\index .php on line 13"

I have the following in php.ini:
extension=php_m ysqli.dll

I have php_mysqli.dll in php\ext\. I assume that this is where the
class would be implemented. Is that correct?

Any thoughts what the issue might be?

TIA,
David
Oct 23 '06 #6
Sy
The issue is that you $mysqli is a function not a class. If you want
to reuse this function then it is worth making it into a class.
The call to $mysqli->XXXXX is a call to a class.
Search for object orientated programing in php, or OOP in PHP. This
will let you make the class that you are after.

Oct 23 '06 #7
On 23 Oct 2006 11:29:32 -0700, "Sy" <si***@outdoore xplorers.comwro te:
>$mysqli is a function not a class.
If you want to reuse this function then you need to change the code.
No, the mysqli extension defines a mysqli class for working with MySQL.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 23 '06 #8
Sy
If that is a native class to MySQL then ok (I know nothing of MySQL as
that isnt the database i use). However if you are calling a class from
another location then you need to include/require that class in your
code.

i.e.

include "path/to/the/file/that/has/the/class/in/it";

Oct 23 '06 #9

On 23 Oct 2006 11:46:52 -0700, "Sy" <si***@outdoore xplorers.comwro te:

[context restored]
On Mon, 23 Oct 2006 19:42:40 +0100, Andy Hassall <an**@andyh.co. ukwrote:
>No, the mysqli extension defines a mysqli class for working with MySQL.

If that is a native class to MySQL then ok (I know nothing of MySQL as
that isnt the database i use). However if you are calling a class from
another location then you need to include/require that class in your
code.

i.e.

include "path/to/the/file/that/has/the/class/in/it";
No, the mysqli ___extension___ defines a mysqli class for working with MySQL.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 23 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1874
by: yzzzzz | last post by:
Hi, I am compiling PHP 5.0.2 myself with MySQL support. I did a ./configure --with-mysqli=/usr/local/mysql/bin/mysql_config (see end of post for complete configure) Note: I also have --with-mysql=/usr/local/mysql/. However, I get the same errors when I configure without the mysql extension, just mysqli. And as the documentation says, I...
0
2128
by: Roy Shaw | last post by:
When configuring PHP5 (5.0.3) to use the mysqli libraries I get a "No such file or directory" from the configure script. My goal is to get PHP5 running with mysql 4.1.09 with both the mysql and mysqli options. I can get it to configure and work correctly with just the mysql but NOT the mysqli or both. Environment: Red Hat Enterprise...
2
2718
by: ojorus | last post by:
Hi! Some questions regarding the mysqli-extension (php5) 1) Prepared statements: If I understand things right, prepared statements will give better performance if you make several similar querys. (where you only change the parameters) But what if you do only ONE query; will it then be usefull to use prepared statements? Can it actuelly give...
13
3690
by: Schmidty | last post by:
If you do a page reload with $_SERVER will your program lose a mysqli connection upon the reload of the page? Would this code work? I need to know how to carry over a connection between methods as I am new to OOP? Thanks... Example; ======================================== <?php // webpage $newsignon = new newuser(); logon();
2
2594
by: Curtis | last post by:
Hello everyone: I have come to love the ease of updating PHP, since getting used to using it these past few years. Recently, however, when I upgraded from PHP 5.1 to PHP 5.2.0 and again when moving to 5.2.1, I noticed strange behavior when trying to load php_mysqli.dll. I am using Apache 2.2.3 on Windows XP Pro (32-bit). I use the...
21
7244
by: Daz | last post by:
Hi everyone. I am trying to create an extension of the mysqli class within PHP, and I am finding it quite difficult. I am fairly new to PHP classes, and decided to give them a go. Here's what I have to far: <?php class sql_db extends mysqli { var $connection = false;
2
3330
by: webcm123 | last post by:
People say that structural programming isn't good for database connection. I code fast-running structural oriented CMS and I don't know what I should do. I use mysql connection using mysql_*. I want also to use SQLite. Can you give me some advices? 1. PHP4 is still used. I want to be compatible. 2. There are various methods - MySQL,...
2
3200
by: Michael | last post by:
Hi, I try to use mysqli object instead of standard mysql functions. Is it ok to create mysqli object within my class or schould I pass mysqli object to my object. The problem is, with code below I must call mysqli->connect() each time I call class methods. How do I create an connection for hole object, so methods can do queries without...
1
2391
by: chanshaw | last post by:
Alright so I got php running and installed i have mysql running and installed the thing im having a hard time with is having the php to call information from the mysql database. Im on Windows Vista Ultimate, I'm using iis7 here is the code of the php. <?php $Username = "Webuser"; $Password = "password"; $Database = "sample"; ...
0
7417
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7601
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7763
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7365
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7701
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5289
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4908
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3402
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.