We help IT Professionals succeed at work.
Get Started

Fatel Error connecting to SQL through PHP page

Ryan Bayne
Ryan Bayne asked
Last Modified: 2013-12-12
I can use php to connect to mysql with no problems but this is the first of me trying a mssql connection and I have a fatel error. Anything you can see I'm doing wrong from these details and anything I should do?

These are the two php extensions I uncommented...

Dont worry about the password etc its all local and a university test database and access made up data.

Can you please confirm the  host and database settings. Database is the name of the database and host is something like RRB/SQLEXPRESS?   Just need to make sure I know the basics.

Fatal error: Call to undefined function mssql_connect() in C:\AppServ\www\ifolio\test.php on line 21
  /* Program: PetCatalog.php
   * Desc:    Displays a list of pet categories from the
              PetType table. Includes descriptions.
   *          User checks radio button.
<head><title>PHP Test Page</title></head>
$Conn = mssql_connect("SQLEXPRESS","test","25130217cmt") or die("Unable to connect to server");
  $query = "SELECT * FROM test";#
  while($RS = mssql_fetch_array($SQL))
echo 'test'.$RS['test'].' ';
  $result = mssql_query($query)
       or die ("Couldn't execute query.");              #21

Open in new window

Watch Question
Developer | Solutions Architect | CTO
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE