Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell driver drivers email error ethernet excel firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition password problem router slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP connection to MSSQL


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
msfdisk's Avatar
Member with 35 posts.
 
Join Date: Jan 2007
22-Feb-2007, 10:40 AM #1
PHP connection to MSSQL
I think I have everything all correct in my connection, however Do I have to have a user name and password to connect to the db on the web server? The DBA just told me to use windows auth. that works with my local machine connecting to the local db but not on the web server.

Here is what I have for connection:

$host = "SQLEXPRESS";
$database = "mydatabasename";
$dbUser = "";
$dbPass = "";

//connect
$connect = mssql_connect("$host", "$dbUser", "$dbPass") or die("could not connect to server");
knight_47's Avatar
Senior Member with 1,187 posts.
 
Join Date: Mar 2006
Location: →
Experience: Um... Green?!
23-Feb-2007, 12:18 AM #2
Yes you do need a username and password that connects to your Database. Also, not only do you have to create a username, with a pass, you have to ADD that to the database, with full permissions. You should be able to do this in your Hostings Control Panel.

I'm not very good with Databases right now, but check out this link for more info:

http://www.phpfreaks.com/tutorials/142/0.php
__________________
Gibbs's Avatar
Senior Member with 638 posts.
 
Join Date: Feb 2005
Location: England
Experience: Intermediate
23-Feb-2007, 08:30 AM #3
For host you would use a domain (www.domain.com), localhost (localhost or 127.0.0.1) or an IP address.

The user/pass is usually the username/password provided/used by your host.

If your running the server locally (on your PC at home) you should use "root" for testing and if you haven't set a password then there most likely won't be one.

Are to trying to connect to a remote database (one that's not on your computer)?
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:05 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.