mysql functions are not working
Moderator: General Moderators
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
mysql functions are not working
i have recently installed php and mysql on my system
the problem is all other functions are working properly but only
mysql related functions are not working like
mysql_connect
mysql_select_db etc.
do i have to configure something in php.ini or something else
the problem is all other functions are working properly but only
mysql related functions are not working like
mysql_connect
mysql_select_db etc.
do i have to configure something in php.ini or something else
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
The code is :
error is:
Call to undefined function mysql_connect()
Code: Select all
<?
$HTTP_HOST="e;localhost"e;;
//$DOCROOT="e;localhost"e;;
$conn=mysql_connect("e;localhost"e;,"e;root"e;,"e;123"e;) or die("e;Not Connected"e;);
mysql_select_db("e;test"e;,$conn) or die("e;Could not connectd to database"e;);
if($conn)
{
echo "e;Database is successfully connected"e;;
}
else
{
echo "e;Database is not connected."e;;
}
?>Call to undefined function mysql_connect()
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
sorry for the wrong extension name but you found it.
next you will have to check the your the path to your extension_dir
mine for example is
extension_dir = "c:/development/php/extensions/"
in the php.ini file.
make sure that the php_mysql.dll is in the directory.
what version of php are you running?
next you will have to check the your the path to your extension_dir
mine for example is
extension_dir = "c:/development/php/extensions/"
in the php.ini file.
make sure that the php_mysql.dll is in the directory.
what version of php are you running?
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
thanx guru but i dont have extensions folder at all in my php folder...i hav searched through the net and i found out that sometimes such dlls are mising in php version 5...so if u hav any idea about where kan i find this dll..bcause i hav searched php.net but i cudnt find...or if u hav any other solution in ur mind ..i wud really apreciate
you used the installer didn't you?
go to http://www.php.net/downloads.php and download the windows zip package as believe there it comes with the right extensions dir called ext. copy and past it into your php folder the set the extension_dir to that folder in your php.ini folder.
go to http://www.php.net/downloads.php and download the windows zip package as believe there it comes with the right extensions dir called ext. copy and past it into your php folder the set the extension_dir to that folder in your php.ini folder.
If i may but in here.. I use easyphp from easyphp.org and have found it too be a great little application.
It installs apache/php/mysql/phpmyadmin for you. Which leaves you time to code instead of debugging systems setups.
PS. I use this on my local machine for developing not as a server app.
cheers, will.
It installs apache/php/mysql/phpmyadmin for you. Which leaves you time to code instead of debugging systems setups.
PS. I use this on my local machine for developing not as a server app.
cheers, will.
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
sorry to bother u again guru
now i did eaxactly the same thing i have copied the est folder to c:/php folder and extension_dir = ':\php\bin\'
but still i hav got the same error but this time it shows the path that it cannot find c:\php\bin\php_mysql.dll
but i dont understand now why it doesnt pick the dll library
now i did eaxactly the same thing i have copied the est folder to c:/php folder and extension_dir = ':\php\bin\'
but still i hav got the same error but this time it shows the path that it cannot find c:\php\bin\php_mysql.dll
but i dont understand now why it doesnt pick the dll library
Mysql
Hie,
You have to set ur extensions directory in the php.ini file.
Change it as follows :
extension_dir = "C:/php/ext/"
You have to store all ur extension dlls in this folder.
You should then enable the mysql extension.
extension=php_mysql.dll
A s m i e
You have to set ur extensions directory in the php.ini file.
Change it as follows :
extension_dir = "C:/php/ext/"
You have to store all ur extension dlls in this folder.
You should then enable the mysql extension.
extension=php_mysql.dll
A s m i e
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
create a file and call it phpinfo.php
copy and paste the code below into it
save the file some where you server can access it and run the file.
do you see mysql in the list?
what is the error message you are getting now?
copy and paste the code below into it
Code: Select all
<?php
phpinfo();
?>do you see mysql in the list?
what is the error message you are getting now?