Jump to content


Photo

plz i have a strange error


  • Please log in to reply
7 replies to this topic

#1 alkhatareykha

alkhatareykha
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 09 August 2006 - 03:48 PM

good night

when i try to connect to my sql from php showing to me this error

FATAL ERROR mysql_connect undifined

i write my code like any one connect to mysql from php

$host="localhost";
$user="root";
$pass="";

$link=mysql_connect($host,$user,$pass) or die ('connection failed');

notice: i changed windows
changed mysql virgin
changed php virgin
please help me
send me at this email
ah_forislam@yahoo.com

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 09 August 2006 - 03:53 PM

Do you get this type of error:
Fatal error: Call to undefined function mysql_connect() in [path of script here] on line [line number here]
if you do and you have PHP5 installed on a Windows server, have a read of this FAQ

if you are on a *unix box you'll want to recompile PHP5 with the --with-mysql command option.


#3 alkhatareykha

alkhatareykha
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 August 2006 - 12:29 PM

thank u man i will tray it now
thanks alot

#4 alkhatareykha

alkhatareykha
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 August 2006 - 04:13 PM

i traied as u told me but didn,t work please send me

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 August 2006 - 04:42 PM

Okay could you provide the following information:
1. What Operating System does your server run on
2. What is your server running, Apache or IIS

Also could you provide information about how you have setup PHP, and post here any tutorials you have followed to install PHP

#6 alkhatareykha

alkhatareykha
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 August 2006 - 04:46 PM

i,m working at windows xp sp1
iis 4
php5
mysql 5

please send me

#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 August 2006 - 05:04 PM

I have no experience with IIS, but this isnt the problem.

Could you post what you used to install PHP. Did you use the installer or the zipped bineries package? If you used the installer then that has a few files missing from it. Instead download the Zipped Bineries and extract the contents of the zip file to where you have installed PHP to, overwritting any existing files.

Also make sure PHP is using the correct php.ini file by creating a  file called info.php and add this init:
<?php
phpinfo();
?>

Now run that file, look for the Configuration File (php.ini) Path. Look to the right of that and it should state the full path to your php.ini. Is that path correct?

I dont know whether this applies to IIS, but when modify the php.ini restart the server.

#8 xAtlas

xAtlas
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 11 August 2006 - 08:24 PM

good night

when i try to connect to my sql from php showing to me this error

FATAL ERROR mysql_connect undifined

i write my code like any one connect to mysql from php

$host="localhost";
$user="root";
$pass="";

$link=mysql_connect($host,$user,$pass) or die ('connection failed');

notice: i changed windows
changed mysql virgin
changed php virgin
please help me
send me at this email
ah_forislam@yahoo.com


are you trying to connect to a database within MySQL? If so, you need:

$hostname = 'localhost';
$dbname = 'your_db_name_here';
$dbuser = 'root';
$dbpass = '';

Also, what is the location that you are hosting from (e.g. paid hosting or hosting from home)?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users