• konkhra

    (@unix082)


    Hi all!

    I am interested to know if something like this is feasible in WordPress.

    I would like to create posts automatically with information stored in non-wordpress database. The database has a table called Library which is like this:

    book_title | author | book_description | publisher

    I am not interested in doing it through any type of eCommerce plugin. I want to have let’s say 20 books per post, pulled from the database, all being done programmatically, not manually. Is this going to be achieved somehow?

    Thanks!

Viewing 1 replies (of 1 total)
  • pichichi

    (@pichichi)

    Yes it is possible, WordPress has built in functionality to interact with non WordPress database using its wpdb class. You can read more here: https://developer.www.ads-software.com/reference/classes/wpdb/

    For example, create a new class then run your query:

    $librarydb = new wpdb( 'user', 'password', 'database', 'hostname' );
    
    $librarydb ->get_results("SELECT yourQueryGoesHere"); 
Viewing 1 replies (of 1 total)
  • The topic ‘Post content pulled from non-wordpress database’ is closed to new replies.