WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] New WPDB and connect to MS SQL database? (12 posts)

  1. Diogo15
    Member
    Posted 3 years ago #

    Is possible to create a New WPDB object and connect to MICROSOFT SERVER SQL database?

    $mydb = new wpdb('username','password','database','localhost');
    $rows = $mydb->get_results("select Name from my_table");

    Just for retrieve some data!!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. Diogo15
    Member
    Posted 3 years ago #

    @esmi is that your ANSWER???
    Is it posible to connect to a MICROSOFT SERVER SQL with wpdb class???

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Sorry - I thought you were trying to connect to your WP database.

  5. Diogo15
    Member
    Posted 3 years ago #

    Thank for you reply anyway,.. do you think you can consult to someone this issue?

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    Best I can offer is to move this topic to the WP-Advanced forum. Perhaps some of the regulars in there can help.

  7. Diogo15
    Member
    Posted 3 years ago #

    Really thanks for your support!!, that would be great!

  8. Mark / t31os
    Moderator
    Posted 3 years ago #

    See if the following guide helps.
    http://wordpress.visitmix.com/development/installing-wordpress-on-sql-server

    Apparently an easier solution is to just install a MySQL server on the same server you have MSSQL on, they should run just fine alongside one another.

  9. Diogo15
    Member
    Posted 3 years ago #

    Mark / t31os, thanks for your reply, but i dont want to install wordpress on SQLSERVER, i JUST want to make a query to database on SQLSERVER(this db is NOT wordpress related)..

  10. Mark / t31os
    Moderator
    Posted 3 years ago #

    The WPDB class is designed for MySQL databases, so no i don't think you can query a MSSQL database, not using WordPress functions at least, you'll need to just do some straight PHP.

    http://www.php.net/manual/en/ref.mssql.php

  11. Diogo15
    Member
    Posted 3 years ago #

    Thanks a lot for your reply!!!

  12. Mark / t31os
    Moderator
    Posted 3 years ago #

    You're welcome. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags