$mssql = odbc_connect( and odbc_exec code

Results 1 to 10 of 10
  1. #1
    Member QueenBEA is offline
    MemberRank
    Jan 2009 Join Date
    nederlandLocation
    41Posts

    $mssql = odbc_connect( and odbc_exec code

    $mssql = odbc_connect( and odbc_exec code
    hi i am having problems with $mssql = odbc_connect(
    and odbc_exec can anyone help i cant seem to get them to work


  2. #2
    ThuGie.NL - Webmaster ThuGie is offline
    True MemberRank
    Apr 2006 Join Date
    NetherlandsLocation
    1,113Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    Hey,

    Perhaps you should give more information.
    What does not work ? does it not connect ? does it give a error ?

    How are you using it ?
    Got a sample of your code ?
    Hate me or Love me, Just dont bother me!
    Only argument i lose, is a argument with my gf, where even when i am right i lose

  3. #3
    Member QueenBEA is offline
    MemberRank
    Jan 2009 Join Date
    nederlandLocation
    41Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    we just need the codes for mssql+odbc_connect with pdo and odbc_exe to see the data

    $cnx = new PDO("odbc:Driver={EFR};Server=localhost;Port:7004;Database=EFR", 'LcLfVJFLTKTCEHRO', '*'); –

  4. #4
    cMuServices cMu is offline
    True MemberRank
    Jan 2017 Join Date
    369Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    new PDO('odbc:Driver={SQL Server Native Client 10};Server='.SQL_HOST.';Database='.SQL_WEB_DB.'', SQL_USER, SQL_PASSWORD)

  5. #5
    Member QueenBEA is offline
    MemberRank
    Jan 2009 Join Date
    nederlandLocation
    41Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    Quote Originally Posted by cMu View Post
    new PDO('odbc:Driver={SQL Server Native Client 10};Server='.SQL_HOST.';Database='.SQL_WEB_DB.'', SQL_USER, SQL_PASSWORD)
    the "new PDO('odbc:Driver={SQL Server Native Client 10};Server='.SQL_HOST.';Database='.SQL_WEB_DB.'', SQL_USER, SQL_PASSWORD)" is added on the code. but the global odbc_exec is lacking.

  6. #6
    cMuServices cMu is offline
    True MemberRank
    Jan 2017 Join Date
    369Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    Quote Originally Posted by QueenBEA View Post
    the "new PDO('odbc:Driver={SQL Server Native Client 10};Server='.SQL_HOST.';Database='.SQL_WEB_DB.'', SQL_USER, SQL_PASSWORD)" is added on the code. but the global odbc_exec is lacking.
    provide full code, is there any reason you uses odbc connection? that's should be like the last choice for you to do...

  7. #7
    4IT.BZ - Cheap VPS NOC is offline
    Gold SubscriberRank
    Sep 2011 Join Date
    822Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    Are the correct PHP extensions enabled to allow this ?

    Windows & Linux NVME VPS Servers - Instant Activation - Starting at £4.50

    I do have permission to display this in my sig from Mental

  8. #8
    Member QueenBEA is offline
    MemberRank
    Jan 2009 Join Date
    nederlandLocation
    41Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    Quote Originally Posted by cMu View Post
    provide full code, is there any reason you uses odbc connection? that's should be like the last choice for you to do...

    define("Username", 'sa');
    define("Passowrd", 'dbpassword');
    define("DSN", 'odbc:Driver={SQL Server};server=SERVERNAME\SQLEXPRESS');
    try {
    $mssql = new PDO("odbc:Driver={SQL Server};server=SERVERNAME\SQLEXPRESS;DATABASE=account_dbf", Username, Passowrd);
    }
    catch(PDOException $exception){
    echo "Connection error: " . $exception->getMessage();
    }
    $query = "SELECT account, FROM ACCOUNT_DBF.dbo.ACCOUNT_TBL";
    $stmt = $mssql->prepare($query);
    $stmt->execute();

  9. #9
    cMuServices cMu is offline
    True MemberRank
    Jan 2017 Join Date
    369Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    Quote Originally Posted by QueenBEA View Post
    define("Username", 'sa');
    define("Passowrd", 'dbpassword');
    define("DSN", 'odbc:Driver={SQL Server};server=SERVERNAME\SQLEXPRESS');
    try {
    $mssql = new PDO("odbc:Driver={SQL Server};server=SERVERNAME\SQLEXPRESS;DATABASE=account_dbf", Username, Passowrd);
    }
    catch(PDOException $exception){
    echo "Connection error: " . $exception->getMessage();
    }
    $query = "SELECT account, FROM ACCOUNT_DBF.dbo.ACCOUNT_TBL";
    $stmt = $mssql->prepare($query);
    $stmt->execute();
    And what is the exact error you get?

  10. #10
    Member QueenBEA is offline
    MemberRank
    Jan 2009 Join Date
    nederlandLocation
    41Posts

    Re: $mssql = odbc_connect( and odbc_exec code

    it is fixed now thanks for you help
    we have to figure it out now theses are the codes php.pdo
    define("Username", 'sa');
    define("Passowrd", 'dbpassword');
    define("DSN", 'odbc:Driver={SQL Server};server=SERVERNAME\SQLEXPRESS');
    try {
    $mssql = new PDO("odbc:Driver={SQL Server};server=SERVERNAME\SQLEXPRESS;DATABASE=account_dbf", Username, Passowrd);
    }
    catch(PDOException $exception){
    echo "Connection error: " . $exception->getMessage();
    }
    $query = "SELECT account, FROM ACCOUNT_DBF.dbo.ACCOUNT_TBL";
    $stmt = $mssql->prepare($query);
    $stmt->execute();



Advertisement