• jolona

    (@jolona)


    I need to show out of wordpress the title and date from a blog WordPress mysql Data Base. How could I make the request? Could you give me an example?

    I tried to do this but it doesn′t work (it is strange because with andother not-wordpress database it works well):

    <?
    //connect with database
    
    $connect=mysql_connect("localhost","myuser","mypassword");
    
    //select database
    
    mysql_select_db("mydatabase",$connect);
    
    //make querys
    
    $result=mysql_query("select * from wp_posts order by fecha DESC limit 0,20", $connect);
    $totalregistros=mysql_num_rows($result);
    
    //print results in array
    
    while($row=mysql_fetch_array($result))
    {
    echo $row[post_title];
    echo "";
    echo $row[post_date];
    }
    mysql_free_result($result)
    ?>

    Thanks for your answer. I need help!!!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I use data from a mysql wordpress data base?’ is closed to new replies.