PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

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 Dev Shed Forums Sponsor:
  #1  
Old January 31st, 2013, 02:43 PM
jaykappy jaykappy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 241 jaykappy User rank is Sergeant (500 - 2000 Reputation Level)jaykappy User rank is Sergeant (500 - 2000 Reputation Level)jaykappy User rank is Sergeant (500 - 2000 Reputation Level)jaykappy User rank is Sergeant (500 - 2000 Reputation Level)jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 12 h 23 m 54 sec
Reputation Power: 10
Connect to db

Trying this

$db = new PDO ("mssql:host=$hostname;dbname=$dbname";charset=utf8","$username","$password", $options);

I have a website created on my server that also has the SQL Server on it. Just testing here.

how do I specify my host name?

Reply With Quote
  #2  
Old January 31st, 2013, 02:51 PM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,867 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 9 h 6 m 6 sec
Reputation Power: 581
PHP Code:
 $hostname="localhost"
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old February 1st, 2013, 06:43 AM
mohnish mohnish is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Location: Visakhapatnam
Posts: 11 mohnish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 57 m 40 sec
Reputation Power: 0
Quote:
Originally Posted by jaykappy
Trying this

$db = new PDO ("mssql:host=$hostname;dbname=$dbname";charset=utf8","$username","$password", $options);

I have a website created on my server that also has the SQL Server on it. Just testing here.

how do I specify my host name?


$hostname='localhost';

$dbname='your db name';

The same with username and password.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Connect to db

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap