473,473 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MySQLi problem in PHP

Although I've been programming for over 30 years I am new to web
development.
As an introduction I've been using a book "PHP and MYSQL Web
Development" by Luke Welling and Laura Thomson.
I've set up an Apache Server v1.3.31.
I've also installed MySQL V5.0.13 and PHP v 5.0.5.
I've gone through the installations several times. I'm reasonably
confident about the Apache Server but I have a problem with the
interaction of the PHP and MYSql.
I'm trying to connect to a MySQL database using PHP. I'm using the new
mysqli_connect structure. I've also tried the straight procedural
version mysqli_connect function.
When I run the code I get a "Call to undefined function mysqli_connect".
I've set up my PHP.ini file to point to the correct php ext file and
I've included references to the php_mysqli.dll but I still get the error
message.
In addition if I stop and then restart the Apache server - which is
linked into PHP - I get an error message saying that PHP can't find the
module php_mysqli.dll.
I'm sure I have defined my extension_dir correctly as
extension_dir = "C:/PHP/ext/"
I know the dll is in this directory but it is not getting picked up. As
this is currently a total block can anyone help please!

Thanks

Malcolm

Oct 11 '05 #1
7 1696
The first thing to check is if your installation is using the version of
php.ini which you think it is.

Run a script containing only
phpinfo();

and take a look.

If that's all OK, then did you stop IIS when installing PHP and Apache? If
not, try uninstalling and reinstalling with IIS stopped.

Cheers

Mark
Although I've been programming for over 30 years I am new to web
development.
As an introduction I've been using a book "PHP and MYSQL Web
Development" by Luke Welling and Laura Thomson.
I've set up an Apache Server v1.3.31.
I've also installed MySQL V5.0.13 and PHP v 5.0.5.
I've gone through the installations several times. I'm reasonably
confident about the Apache Server but I have a problem with the
interaction of the PHP and MYSql.
I'm trying to connect to a MySQL database using PHP. I'm using the new
mysqli_connect structure. I've also tried the straight procedural
version mysqli_connect function.
When I run the code I get a "Call to undefined function mysqli_connect".
I've set up my PHP.ini file to point to the correct php ext file and
I've included references to the php_mysqli.dll but I still get the error
message.
In addition if I stop and then restart the Apache server - which is
linked into PHP - I get an error message saying that PHP can't find the
module php_mysqli.dll.
I'm sure I have defined my extension_dir correctly as
extension_dir = "C:/PHP/ext/"
I know the dll is in this directory but it is not getting picked up. As
this is currently a total block can anyone help please!


Oct 11 '05 #2
Mark thanks but....
Mark Rees wrote:

The first thing to check is if your installation is using the version of
php.ini which you think it is.

Run a script containing only
phpinfo();
Did that and it looks as if its using the php.ini in c:/php which is
what I would expect. and take a look.

If that's all OK, then did you stop IIS when installing PHP and Apache? If
not, try uninstalling and reinstalling with IIS stopped.
Don't have IIS installed. IIS is a server (I think!) and I'm using the
Apache server.
I stop the Apache server every time that I made a change to php.ini and
then restarted but it still doesn't see the php_mysqli.dll.

Malcolm
Cheers

Mark
Although I've been programming for over 30 years I am new to web
development. ....
I'm trying to connect to a MySQL database using PHP. I'm using the new
mysqli_connect structure. I've also tried the straight procedural
version mysqli_connect function.
When I run the code I get a "Call to undefined function mysqli_connect".
I've set up my PHP.ini file to point to the correct php ext file and
I've included references to the php_mysqli.dll but I still get the error
message.

....
Oct 11 '05 #3
Well, what your phpinfo(); script says? Check the manual for it's
specific location of php.ini file. This file location matters!

Don't loose your hair rightaway! You might forget about all these
installaton troubles, just get a full php+mysql+apache package on
windows ... like xampp!

http://www.apachefriends.org/en/xampp.html

with MySQL 4.1.15 and PHP 5.0.5 ....

Just download the whole package and extract that to some root drive
a-n-d you are on the run!
--
Raqueeb Hassan
Bangladesh

Oct 11 '05 #4
Raqueeb Hassan wrote:
Well, what your phpinfo(); script says? Check the manual for it's
specific location of php.ini file. This file location matters!

Don't loose your hair rightaway! You might forget about all these
installaton troubles, just get a full php+mysql+apache package on
windows ... like xampp!

http://www.apachefriends.org/en/xampp.html

with MySQL 4.1.15 and PHP 5.0.5 ....

Just download the whole package and extract that to some root drive
a-n-d you are on the run!
--
Raqueeb Hassan
Bangladesh

Thanks for this tip Raqueeb. I've downloaded and got it working though
I'm still having problems. Do you know into what directory I have to put
the PHP source files?

Cheers

Malcolm

Oct 11 '05 #5
Malcolm Wright wrote:
Raqueeb Hassan wrote:
Well, what your phpinfo(); script says? Check the manual for it's
specific location of php.ini file. This file location matters!

Don't loose your hair rightaway! You might forget about all these
installaton troubles, just get a full php+mysql+apache package on
windows ... like xampp!

http://www.apachefriends.org/en/xampp.html

with MySQL 4.1.15 and PHP 5.0.5 ....

Just download the whole package and extract that to some root drive
a-n-d you are on the run!
--
Raqueeb Hassan
Bangladesh

Thanks for this tip Raqueeb. I've downloaded and got it working though
I'm still having problems. Do you know into what directory I have to put
the PHP source files?

Cheers

Malcolm


Malcolm,

It's also possible Apache can't load the MySQL client library
(libmysqlclient.lib or mysqlclient.lib). Ensure this library is in a
path where it can be loaded.

What happens if you type just

mysql

at a command prompt? This will load the mysql command interpreter.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 11 '05 #6
Jerry Stuckle wrote:
Malcolm Wright wrote:
Raqueeb Hassan wrote:
Well, what your phpinfo(); script says? Check the manual for it's
specific location of php.ini file. This file location matters!

Don't loose your hair rightaway! You might forget about all these
installaton troubles, just get a full php+mysql+apache package on
windows ... like xampp!

http://www.apachefriends.org/en/xampp.html

with MySQL 4.1.15 and PHP 5.0.5 ....

Just download the whole package and extract that to some root drive
a-n-d you are on the run!
--
Raqueeb Hassan
Bangladesh

Thanks for this tip Raqueeb. I've downloaded and got it working though
I'm still having problems. Do you know into what directory I have to
put the PHP source files?

Cheers

Malcolm


Malcolm,

It's also possible Apache can't load the MySQL client library
(libmysqlclient.lib or mysqlclient.lib). Ensure this library is in a
path where it can be loaded.

What happens if you type just

mysql

at a command prompt? This will load the mysql command interpreter.

Hi Jenny,
Yes it responds with the mysql prompt and login. I can there get to the
normal mysql functionality. I set all the neccessary paths - which made
it all the more confusing that it couldn't see the dll.
Thanks

Malcolm

Oct 12 '05 #7
Jerry Stuckle wrote:
Malcolm Wright wrote:
Raqueeb Hassan wrote:
Well, what your phpinfo(); script says? Check the manual for it's
specific location of php.ini file. This file location matters!

Don't loose your hair rightaway! You might forget about all these
installaton troubles, just get a full php+mysql+apache package on
windows ... like xampp!

http://www.apachefriends.org/en/xampp.html

with MySQL 4.1.15 and PHP 5.0.5 ....

Just download the whole package and extract that to some root drive
a-n-d you are on the run!
--
Raqueeb Hassan
Bangladesh

Thanks for this tip Raqueeb. I've downloaded and got it working though
I'm still having problems. Do you know into what directory I have to
put the PHP source files?

Cheers

Malcolm


Malcolm,

It's also possible Apache can't load the MySQL client library
(libmysqlclient.lib or mysqlclient.lib). Ensure this library is in a
path where it can be loaded.

What happens if you type just

mysql

at a command prompt? This will load the mysql command interpreter.

Strangely enough there was another person with exactly the same problem
as I was having - see "PHP Configuration Troubles" further down this
newsgroup. I followed the advice given in that answer, upgraded to
Apache2 and copied libraries as suggested and it all works now.
Thanks to all who responded.

Malcolm Wright

Oct 12 '05 #8

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

Similar topics

0
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...
0
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...
2
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...
12
by: davids58 | last post by:
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');...
2
by: Curtis | last post by:
Hello everyone: Recently, I decided to upgrade to PHP 5.2.0. I have C:\php5 in the Windows XP PATH, so upgrading is quite painless; just unzip new release, and restart Apache! Usually it goes...
13
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...
2
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...
21
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...
2
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...
2
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...
0
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...
0
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,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.