|
-
Dec 7th, 2009, 09:31 PM
#1
Thread Starter
Lively Member
[RESOLVED] php to MSSQL connection
I am trying to connect to a godaddy hosted MSSQL database with php. here is my connection string with generic information:
HTML Code:
<?php
$myServer = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
$myUser = "username";
$myPass = "password";
$myDB = "dbname";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
what am I doing wrong? it fails at
mssql_connection
thanks everyone.
-
Dec 7th, 2009, 09:41 PM
#2
Re: php to MSSQL connection
That would appear to be a slight spelling mistake:
PHP Code:
$dbhandle = mysql_connect($myServer, $myUser, $myPass)
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Dec 7th, 2009, 09:54 PM
#3
Re: php to MSSQL connection
.. lol.
no, it's not a spelling mistake. MSSQL is another type of database (Microsoft SQL Server), and PHP supports it with functions similar to the MySQL functions; they are prefixed with "mssql_."
talk to your host and ensure you are using the right server. I know that godaddy has incredibly weird URLs for their MySQL servers, so they might do the same for MSSQL. you could also ask if they might be able to provide some sample code to connect to their MSSQL server -- but, I'm not sure they would be able to provide it.
edit: also, make sure you're specifying a port in $myServer whenever you're trying to connect; this would be in the format: server:port
Last edited by kows; Dec 7th, 2009 at 09:58 PM.
-
Dec 7th, 2009, 10:03 PM
#4
Thread Starter
Lively Member
Re: php to MSSQL connection
I sent a help request to godaddy before I came here. I was confident in the php but thought I would check.
I will post the solution if godaddy is able to help me out.
Thanks so far. If anyone notices something I am missing or has a similar godaddy experience I still consider this open.
-
Dec 7th, 2009, 10:10 PM
#5
Re: php to MSSQL connection
I'm not sure if this would help.
Where can I find database connection strings for my MS SQL database?
Connection strings can be found in the Hosting Control Center.
1. Log in to your Account Manager.
2. In the My Products section, select Hosting.
3. Next to the hosting account you want to modify, click Manage Account.
4. In the Databases section of the Hosting Control Center, click the SQL server icon.
5. Click the pencil icon next to the database you would like to get connection strings for to open its edit features.
6. Click the Configuration icon in the menu bar.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Dec 7th, 2009, 10:15 PM
#6
Thread Starter
Lively Member
Re: php to MSSQL connection
they do not put a PHP string in there. it would be nice if they did.
i might have to wait for godaddy to get back with me on this one. google has not been very helpful.
-
Dec 8th, 2009, 08:04 PM
#7
Thread Starter
Lively Member
Re: php to MSSQL connection
so here is the solution: switch to mysql / PHP solution.
this was the response from Godaddy.
Dear SirMadam,
Thank you for contacting Online Support.
I apologize for any inconvenience this may have caused. Unfortunately connecting to MS SQL via PHP is not supported.
thanks everyone for your help.
-
Dec 9th, 2009, 01:10 AM
#8
Re: php to MSSQL connection
 Originally Posted by downat420
so here is the solution: switch to mysql / PHP solution.
this was the response from Godaddy.
thanks everyone for your help.
What type of account do you have with godaddy?
I just found this. Looks like you can only get MSSQL on Windows Server 2003 dedicated hosting with godaddy.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Dec 9th, 2009, 01:48 AM
#9
Thread Starter
Lively Member
Re: [RESOLVED] php to MSSQL connection
a windows box, not dedicated, 5 bucks. i get 1 mssql database included or 1000 mysql databases. it is just easier to use mysql. i have no real reason for using mssql except i am more familiar with it.
-
Dec 9th, 2009, 11:35 AM
#10
Re: php to MSSQL connection
I apologize for any inconvenience this may have caused. Unfortunately connecting to MS SQL via PHP is not supported.
I have to wonder why... Probably just GoDaddy being GoDaddy I guess; I buy domains from them, but I don't think I've heard anything good about their hosting...
-
Dec 9th, 2009, 11:55 AM
#11
Re: [RESOLVED] php to MSSQL connection
I don't like their hosting and the way they have it set up -at all-, it's incredibly annoying. it might be nice for novice "web masters," but I just can't stand it.
however, I refuse to go anywhere else for domains.
-
Dec 9th, 2009, 09:34 PM
#12
Thread Starter
Lively Member
Re: [RESOLVED] php to MSSQL connection
thanks for the novice and "web masters" remark.
i have used them for years. i have used worse hosting services. they are cheap.
-
Dec 9th, 2009, 10:38 PM
#13
Re: [RESOLVED] php to MSSQL connection
 Originally Posted by kows
I don't like their hosting and the way they have it set up -at all-, it's incredibly annoying. it might be nice for novice "web masters," but I just can't stand it.
Neither can I! I also find their website layout confusing to navigate too.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|