Author Topic: PHP/MySQL problems  (Read 787 times)

Maniaman

  • Member
  • **
  • Posts: 188
  • Kudos: 0
PHP/MySQL problems
« on: 19 December 2002, 07:23 »
I'm having some problems with my Install of PHP and MySQL.

On a PHP sciprt I made I need it to connect to MySQL.
I keep getting this error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/register1.php on line 21

Here's Line 21 of that file

mysql_connect("localhost", "root", "*");

*Password Removed

It works on other builds of PHP...

Also, where does MySQL keep all of it's configuration? (Stupid question)
I use my hotmail email on here to keep from begin spammed by trolls. If you want my good email address for something then ask... :)


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
PHP/MySQL problems
« Reply #1 on: 19 December 2002, 08:16 »
What distro please?  If it's Red Hat you'll need to install the "php-mysql" RPM from your CD. The equivalent of that will need to be installed on any other Linux distro. And of course MySQL has to be installed but I am sure you know that. It would depend on what distro you are using as the where it's configuration files are.

[ December 18, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Maniaman

  • Member
  • **
  • Posts: 188
  • Kudos: 0
PHP/MySQL problems
« Reply #2 on: 20 December 2002, 00:07 »
Distro = Linux Mandrake 9.0

I also have installed the php-mysql rpm

[ December 19, 2002: Message edited by: Maniaman ]

I use my hotmail email on here to keep from begin spammed by trolls. If you want my good email address for something then ask... :)


KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
PHP/MySQL problems
« Reply #3 on: 20 December 2002, 00:29 »
quote:
Originally posted by Maniaman:
I'm having some problems with my Install of PHP and MySQL.

On a PHP sciprt I made I need it to connect to MySQL.
I keep getting this error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/register1.php on line 21

Here's Line 21 of that file

mysql_connect("localhost", "root", "*");

*Password Removed

It works on other builds of PHP...

Also, where does MySQL keep all of it's configuration? (Stupid question)



Haa it connected before on another page, have you made a simple sql connection test?
Contains scenes of mild peril.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
PHP/MySQL problems
« Reply #4 on: 20 December 2002, 00:32 »
And you have MySQL and MySQL-client RPMs installed? And the MySQL server is up and running? And you have php and php-common RPMs installed?

I don't have Mandrake 9.0, this stuff just works when installed on Red Hat. I haven't found anything on the web to indicate it should be any harder than this on Mandrake. Sorry if I haven't been much help.

P.S. You never would want to use "root" and root's real Linux password in a PHP script.

P.S.S. I notice Mandrake breaks out Apache into more RPMS. I don't know if these are needed but other RPMs you might want to make sure are installed are:

apache-common
apache-conf
apache-modules

[ December 19, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Maniaman

  • Member
  • **
  • Posts: 188
  • Kudos: 0
PHP/MySQL problems
« Reply #5 on: 20 December 2002, 00:36 »
This is the first script that I've used with MySQL...

I'm a n00b when it comes to stuff like this so what's a connection test? If it's a script that just tries to connect to MySQL, then no. That doesn't work
I use my hotmail email on here to keep from begin spammed by trolls. If you want my good email address for something then ask... :)


KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
PHP/MySQL problems
« Reply #6 on: 20 December 2002, 00:44 »
Try this one:


Code: [Select]

delete the (REMOVEME)
Contains scenes of mild peril.

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
PHP/MySQL problems
« Reply #7 on: 20 December 2002, 00:46 »
Also, is mysql actually running?

can you do
$ mysqladmin ping
for me?
Contains scenes of mild peril.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
PHP/MySQL problems
« Reply #8 on: 20 December 2002, 00:48 »
The thing that leads me to believe he doesn't have all the necessary RPMs installed is it says mysql_connect() is an undefined function. That should be part of php-mysql. I would think he would get a different error if it recognized the function but was improperly used.
Someone please remove this account. Thanks...

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
PHP/MySQL problems
« Reply #9 on: 20 December 2002, 00:55 »
quote:
Originally posted by void main:
The thing that leads me to believe he doesn't have all the necessary RPMs installed is it says mysql_connect() is an undefined function. That should be part of php-mysql. I would think he would get a different error if it recognized the function but was improperly used.


Hmm, good point.
Maniaman I would install Mandrake98.0 and take a look at this for you, but my mandrake 9 CD's don't work so I said fsck it...
Contains scenes of mild peril.

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
PHP/MySQL problems
« Reply #10 on: 20 December 2002, 00:57 »
and if anybody say's you can't fsck a CD I will kill you because that would be a poor attempt at comedy.
Contains scenes of mild peril.

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
PHP/MySQL problems
« Reply #11 on: 20 December 2002, 01:02 »
Contains scenes of mild peril.

Maniaman

  • Member
  • **
  • Posts: 188
  • Kudos: 0
PHP/MySQL problems
« Reply #12 on: 21 December 2002, 00:52 »
I already have that package installed Tux... It still wont work.
I use my hotmail email on here to keep from begin spammed by trolls. If you want my good email address for something then ask... :)


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
PHP/MySQL problems
« Reply #13 on: 21 December 2002, 02:26 »
Do me a huge favor and tell me what is the output of this command:

$ rpm -qa | grep -i mysql
Someone please remove this account. Thanks...

Maniaman

  • Member
  • **
  • Posts: 188
  • Kudos: 0
PHP/MySQL problems
« Reply #14 on: 21 December 2002, 02:33 »
libmysql10-3.23.52-1mdk
perl-Mysql-1.22_19-5mdk
php-mysql-4.2.3-1mdk
MySQL-3.23.54a-1
I use my hotmail email on here to keep from begin spammed by trolls. If you want my good email address for something then ask... :)