post your comment   print   send to a friend
Rate:  67% | Views: 1307
Question categories:  NT Plans

How Can Ms Sql be accessed through PHP scripts?

Answer by: George Kaloyanov, Aplus.Net Knowledge Base Support

You can access your MS SQL database through PHP scripts. You will need the following information:

  • Hostname: You have to use the name of the server that hosts your database.
  • SQL Database Username: The username of your MS SQL Database.
  • Database Password: The password you set when adding your database to your plan.

Your connect script will look something like

mssql_connect(‘server_hostname’, ‘mssql_username’, ‘mssql_password’)

Note: If you do not know the hostname of the database server, please contact our Customer Support team by phone at 1 888 301 2516 (toll free) or 1 858 410 6900 for international callers. You may contact Customer Support by email at , please include your registration number so we can locate your account.

You can test your SQL connection by creating a simple PHP script using the following code:

<?php
$link = mssql_connect('hostname', 'mssql_user', 'mssql_password');
if (!$link) {
   die('Could not connect: ' . mssql_error());
}
echo 'Connected successfully';
mssql_close($link);
?>

Related link:

·          How do I access the SQL server which comes with my Windows hosting plan?

Customer Feedback
Rate:  67% | Views: 1307 | Please Rate:  
 
If you have other comments or ideas for future technical tips, please type them here:

Email: (optional)

Comments: (optional)

 PHP Hosting | Server Hosting    Back to serch results
Browse the Base
Knowledge Base
Shared Hosting
  NT Plans
Messages
 

Get Insider Info and Tips on the Aplus.Net Blog!

It's here! Introducing The Aplus.Net official blog. Check in as we run down the issues important to the web hosting industry, and offer tips and advice on how to make your website the best it can be. You can even post comments and suggest ideas. Get involved with the Aplus.Net community!
Visit the Aplus.Net Blog today!

Private Area
 
Ask
in Private
   
Personal
Folder
 
Related Questions
 
1. How can I connect to a Microsoft Access database using ASP?
 
2. How do I access the SQL Server that comes with my Windows hosting plan?
 
3. Some of the asp pages in my site use ASPEmail or CDONTS mail components but they don't work.
 
4. How do I enable SQL on my Windows plan using Aplus.Net web Control Panel?
 
5. What do i need to do to get an ASP.NET project to work?
 
Home Browse Search Ask in Private Personal Folder   Help
powered by web hosting 
  Logged as: Guest