Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6790853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:46:31+00:00 2026-05-26T17:46:31+00:00

I’ve never really used MS server or anything like that before, i have, however

  • 0

I’ve never really used MS server or anything like that before, i have, however used Linux servers before and know what i am doing there.

I have to use a Windows server with MS SQL now, but i haven’t a clue how to connect to it with PHP, usually it would be a matter of:

    $data = mysql_connect();

But this didn’t work, so i done a bit of research and found this little number:
$data = mssql_connect();

This is used for MS SQL database server, well from what i can’t see. Anyway the problem is, when i use the first, the ‘or die’ method kicks in saying that i cannot connect to the database as you would expect. But when i use the second function, nothing happens, as if i have a syntax error.

Any ideas? Any help getting started with MS SQL Server?

Thanks for the time
Brian.

P.S Heres my code just incase i’m being silly and have done something wrong…..

     $remotedb_host = "";//Here is the server IP address

     $remotedb_username = "user1"; 

     $remotedb_pass = "example"; 

     //$remotedb_name = "exampletable";

     // Run the connection here 
     $dbhandle = mssql_connect($remotedb_host, $remotedb_username, $remotedb_pass)
         or die("Couldn't connect to SQL Server "); 


      echo $dbhandle;

     echo "hello";//this is to test if anything is displayed at all on the page

Also i will be remote connecting from a linux server, is this a bad thing to do? should i keep it all on the Windows Server? Does it make a difference in all fairness?

Thanks Again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:46:32+00:00Added an answer on May 26, 2026 at 5:46 pm

    First of all, about your errors, i recommend adding on top

    ini_set('display_errors','On');
    error_reporting(E_ALL);
    

    This will show you all errors that occur.

    Make sure you have the mssql extension on in your php.ini file (remove the # sign before mssql.so or the ; sign from the mssql.dll)

    Also, try var_dump()ing the $dbhandle instead of echoing it.

    You could also verify the connection by using the following as stated in the PHP Manual :

    if (!$dbhandle) {
        die('Woopsie Daisy!');
    }
    

    Shai

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.