• I am calling data from a separate database in my wordpress posts. In the single.php template, I want to make the process of calling this data automated by comparing the post number to a column I have called ‘postno’ and call the data that has the post number in that field.
    For example, if it is post number 3, it will check which fields have the number 3 in column ‘postno’ and display the records.

    This is the code, but I want to use <?php the_id();?> within it in the place of ‘THE POST NUMBER’:

    <?php
    mysql_connect("localhost", "user", "password") or die(mysql_error());
    mysql_select_db("database") or die(mysql_error());
    
    $result = mysql_query("SELECT * FROM database
     WHERE postno=' <strong>THE POST NUMBER</strong>' ) or die(mysql_error());
    
    while($row = mysql_fetch_array( $result )) {

    Is there a way of doing this?

The topic ‘Using datafeeds with WordPress’ is closed to new replies.