All pastes #408006 Raw Edit

Stuff

public text v1 · immutable
#408006 ·published 2007-03-24 14:32 UTC
rendered paste body
<?
require 'blogconfig.php';
require 'mysqlconnect.php';

$query = "SELECT post_id FROM wp_post2cat WHERE category_id='3' ORDER by post_id DESC";
$result = mysql_query($query);

if (mysql_num_rows($result)!=0) {
        while($riga=mysql_fetch_array($result)) {
                $post_id=$riga['post_id'];
                $query_post = "SELECT * FROM wp_posts WHERE ID='$post_id'";
                $result_post = mysql_query($query_post);
                $riga_post = mysql_fetch_array($result_post);
				echo("<b>" . $riga_post['post_title'] . "</b>" . "<br />");
                echo($riga_post['post_content'] . "<br />");
				
				$query_get_author = "SELECT post_author FROM wp_posts WHERE post_id='$post_id'";
				$result_get_author = mysql_query($query_get_author);
				$author_id=$result_get_author['post_author'];
				$query_author = "SELECT * FROM wp_users WHERE ID='$author_id'";
				$result_author = mysql_query($query_author);
				$riga_author = mysql_fetch_array($result_author);
				echo("Inserito da" . $riga_author);
				echo("<br /><br /><br />");
                }
        }

else {
        echo "Nessun post trovato";
        } 

/* chiusura connessione server MYSQL */
mysql_close();
?>