473,703 Members | 3,067 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 4744
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
1889
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 use the same version of MySQL for both extensions to avoid conflicts.
0
2135
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 Linux 3, rel 4 php 5.0.3 from sources from php.net
2
2732
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 better performance NOT to use prepared statements in that case? 2) Are there any DISadvantages...
13
3711
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
2602
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 php5apache2_2.dll to load PHP as an Apache module. The PHPIniDir directive in httpd.conf points to the...
21
7274
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
3343
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, MySQLi, SQLite, PDO... I have
2
3208
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 connect each time? Best Regards, Michael
1
2411
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"; $Hostname = "localhost"; $MySQLConnection = mysql_connect($Hostname, $Username, $Password) ...
0
8759
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8670
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9252
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6588
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5922
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.