Forums

call database to wordpress using php (5 posts)

  1. lastexile
    Member
    Posted 1 year ago #

    How should I call the table from mysql by using php script?

    any example of the scripts? I just need to display the table data into the page.

    thx you.

  2. Kafkaesqui
    Moderator
    Posted 1 year ago #

  3. lastexile
    Member
    Posted 1 year ago #

    erm, let say my database name "test". and the table i wanted to select the table is call wp_testing. Do php have any code that can select the table wp_testing and display on the page?
    ----------------------------------------
    <?php

    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');

    $db_selected = mysql_select_db('test', $link);

    ?>
    ------------------------------------------------

  4. whooami
    Member
    Posted 1 year ago #

    thats not even close to what it is on the codex. if you are JUST interested in connecting to a db with php, then for heavens sake use google.

    this kinda junk is everywhere.

    http://www.google.com/search?hl=en&q=php+and+mysql+connecting&btnG=Google+Search

  5. Kafkaesqui
    Moderator
    Posted 1 year ago #

    To rephrase what whooami states, around here we can show you how to query in the WordPress way. But if you want to learn generic PHP methods for querying a MySQL database, there are (lots of) other sites which focus on that.

Topic Closed

This topic has been closed to new replies.

About this Topic