PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old March 14th, 2007, 06:32 PM
phpn00b phpn00b is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA, USA
Posts: 4 phpn00b User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP & MySQL no connection

I'm having a perplexing situation.

To start off,

MySQL Version:
URL

MySQL User:
URL

PHP Version:
URL

Connection Problem:
URL

PHP Code with error:
URL

It seems that PHP isn't connecting to MySQL. It's probably as simple as just a switch or setting. I'm new at this and just installed PHP. I know that the MySQL installation is good since our programmer is using .asp and has been using MySQL for about 2 months with no problems.

Any clue as to what I am doing wrong?


Reply With Quote
  #2  
Old March 14th, 2007, 07:44 PM
codewalkers codewalkers is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Philippines
Posts: 82 codewalkers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to codewalkers
RE: PHP & MySQL no connection

$cn=mysql_connect("","","")or die (mysql_error());
$db=mysql_select_db("")or die(mysql_error());

Reply With Quote
  #3  
Old March 14th, 2007, 08:14 PM
phpn00b phpn00b is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA, USA
Posts: 4 phpn00b User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: RE: PHP & MySQL no connection


Quote:
$cn=mysql_connect("","","")or die (mysql_error());
$db=mysql_select_db("")or die(mysql_error());


So I take it, that after establishing the connection with MySQL, it has to choose the db?


Reply With Quote
  #4  
Old March 14th, 2007, 08:50 PM
codewalkers codewalkers is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Philippines
Posts: 82 codewalkers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to codewalkers
RE: RE: RE: PHP & MySQL no connection


Quote:

Quote:
$cn=mysql_connect("localhost","user","password")or die (mysql_error());
$db=mysql_select_db("dbname here")or die(mysql_error());


So I take it, that after establishing the connection with MySQL, it has to choose the db?



Reply With Quote
  #5  
Old March 14th, 2007, 09:47 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information. Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,943 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 5 h 8 m 21 sec
Reputation Power: 3
RE: PHP & MySQL no connection

Make sure that the php mysql lib files are installed, i believe native support was remove in php5. I think it is called Mysqli, if your using Debian/Ubuntu or Redhat/Centos it should be in the default repositories (checked this on my servers). In the repos it should be called something like php5-mysql

Reply With Quote
  #6  
Old March 14th, 2007, 10:02 PM
phpn00b phpn00b is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA, USA
Posts: 4 phpn00b User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP & MySQL no connection

It's on Windows XP Pro 64-bit.

I am beginning to think it's just the PHP connection to MySQL that's the headache.

I checked the /path via "environmental variables. Where does one get "Mysqli"?


Reply With Quote
  #7  
Old March 15th, 2007, 07:53 AM
phpn00b phpn00b is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA, USA
Posts: 4 phpn00b User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP & MySQL no connection

Anyone??


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > PHP & MySQL no connection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway