SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Connect to MsSql using php

    Sorry for the inexperienced question but i was curious to see if anyone could guide me along the right path of how to connect to MsSql using php.

    <?php
    $sql = odbc_connect("server", "username", "******");
    $process = odbc_execute($sql);

    if (!$process) {
    $error = "Nope";
    } else {
    $error = "Yup";
    };

    echo $error;

    ?>

    I tried that and it was a no go.

    <?php
    $sql = mssql_connect("server", "user", "*****");

    if (!$sql) {
    $error = "Nope";
    } else {
    $error = "Yup";
    };

    echo $error;

    ?>

    <?php
    $sql = mssql_pconnect("server", "user", "*****");

    if (!$sql) {
    $error = "Nope";
    } else {
    $error = "Yup";
    };

    echo $error;

    ?>

    Neither of those worked. I'm assuming the problem is somewhere else but i have no clue, and relentless google searching didn't give me any other clues.

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Moved over to the PHP forum where you will get better assistance.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •