It appears you have not yet registered with our community. To register please click here...

DNforum.com - Domain Sales, Domain Forum, Domain Appraisals
 
Register Now!
Register Now for FREE!
Our records show you have not yet registered to our forums. To sign up for your FREE account INSTANTLY fill out the form below!

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:  
Birthday:       I agree to forum rules 

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Reply
 
LinkBack Thread Tools Display Modes
Old 07-19-2005, 12:24 PM   #1 (permalink)
Gold Lifetime Member
 
TvDomain's Avatar
 
Last Online: 06-29-2008 12:06 AM
iTrader: (2)
Join Date: Jul 2005
Posts: 49
DNF$: 110
Location: USA


cant connect to database mysql useing php

i can use administrator mysql to connect to mysql server , it works fine, i use other sofware to connect and edit the database in mysql server , it works fine
BUT whene i use my script to connect to database it dont want to work , it giveme error
Could not connect to the database

---------------------------------------
$link = mysql_connect('localhost', 'root', 'password');
if (! $link)
die('Unable to connect to the databasename database');
mysql_select_db('databasename') or die('Could not open databasename database');

-------------------------------------------------------
mysql=4.1
php=4
i am close to lose it and format this thing
any one help me out here ? befor i crash it please ?
TvDomain is offline   Reply With Quote
Sponsored Links
Old 07-19-2005, 12:30 PM   #2 (permalink)
www.conversys.in
 
dotcomgiant's Avatar
 
Name: Aloke M.
Last Online: Today 11:13 AM
iTrader: (15)
Join Date: Feb 2005
Posts: 762
DNF$: 4,262
Location: Kolkata
Country:


Re: cant connect to database mysql useing php

Try the following :
Code:
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
__________________
Conversys Technologies Private Limited || Redhat Business Partner || Linux Solution | Open Source Development | Server Administration | Remote Infrastructure Management
dotcomgiant is offline   Reply With Quote
Old 07-19-2005, 12:53 PM   #3 (permalink)
Gold Lifetime Member
 
TvDomain's Avatar
 
Last Online: 06-29-2008 12:06 AM
iTrader: (2)
Join Date: Jul 2005
Posts: 49
DNF$: 110
Location: USA


Re: cant connect to database mysql useing php

Can't create TCP/IP socket (5)

that is what it give

Quote:
Originally Posted by TvDomain
Can't create TCP/IP socket (5)

that is what it give

any one can help ?

Last edited by TvDomain; 07-19-2005 at 01:22 PM. Reason: Automerged Doublepost
TvDomain is offline   Reply With Quote
Old 07-19-2005, 04:27 PM   #4 (permalink)
Platinum Lifetime Member
 
cyphix's Avatar
 
Last Online: 08-18-2008 03:38 PM
iTrader: (26)
Join Date: Jan 2003
Posts: 3,559
DNF$: 1,325
Location: Australia
Country:


Re: cant connect to database mysql useing php

Ask your host why u are getting that error.
__________________
538k Lyrics Database Available - Only $49 - Check Here
cyphix is offline   Reply With Quote
Old 07-19-2005, 04:35 PM   #5 (permalink)
Gold Lifetime Member
 
TvDomain's Avatar
 
Last Online: 06-29-2008 12:06 AM
iTrader: (2)
Join Date: Jul 2005
Posts: 49
DNF$: 110
Location: USA


Re: cant connect to database mysql useing php

it is done guys , i fixed it , and it was mysql server problem with autentification , thank anyway
TvDomain is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 06:58 PM.
Copyright @2001-2008 DNForum.com

Learn Domains
Promote Domains
Research Domains
Buy Domains
Resell Domains
Park Domains
Sell Domains
Build Domains
Host Domains
Trademark Domains
Domain Domains
manage Domains
Appraise Domains