Forums

Pullin in category data from seperate wordpress db (2 posts)

  1. MLC-Sam
    Member
    Posted 1 year ago #

    Hi guys

    I need off some help i am looking to pull in data from a specify catgegory but not from their wordpress site from mine.

    So i want one wordpress site to pull in data from another wordpress site i can do it with the following code but i want to pull data from a specific category and help pls.

    $con = mysql_connect("","","");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("", $con);
    
    $result = mysql_query("SELECT * FROM wp_posts WHERE post_type = 'post' AND post_author = '30' LIMIT 5");
    
    $result2 = mysql_query("SELECT * FROM wp_posts WHERE post_type = 'post' AND post_author = '30' LIMIT 5");

    That pulls data in from a specify authors id but i need to grab data or post just from one category their is a category section in the db but they are all set to 0 what does this relate to???

    Any help....

  2. MichaelH
    Volunteer
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags