User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 425,896 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,912 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 214 | Replies: 2
Reply
Join Date: Jun 2008
Posts: 31
Reputation: punithapary is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
punithapary punithapary is offline Offline
Light Poster

connection

  #1  
Jun 12th, 2008
Anyone can tell me.How many ways are there to connect PHP with MYSQL and give me code also pls
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 100
Reputation: cwarn23 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
cwarn23 cwarn23 is offline Offline
Junior Poster

Re: connection

  #2  
Jun 12th, 2008
2 ways but I'm not sure if they both refer to the same type of SQL databases. The first one is:
  1. $linkID = @mysql_connect($dbhost,$accountname,$password)
  2. or die("Could not connect to MySQL server");
  3. @mysql_select_db($database) or die("Could not select database");
And the second is MySQLI and I think might be as follows:
  1. $linkID = @mysqli_connect($dbhost,$accountname,$password,$database)
  2. or die("Could not connect to MySQL server");
  3. @mysqli_select_db($linkID,$database) or die("Could not select database");
The first one i think is more common.
Signature note:
Do not edit the registry just because someone on the forum says so. Do some research on the internet before editing the registry.
Reply With Quote  
Join Date: Jul 2006
Location: Remunj
Posts: 207
Reputation: pritaeas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 25
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Posting Whiz in Training

Re: connection

  #3  
Jun 12th, 2008
Last edited by pritaeas : Jun 12th, 2008 at 5:36 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 7:31 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC