Tutorials ..."; /*** mysql hostname ***/ $hostname = 'localhost'; /*** mysql username ***/ $username = 'username'; /*** mysql ***/ $password = 'password'; $dbname = 'wordpress_database_name'; if (isset($_GET['dbname'])) $dbname = $_GET['dbname']; $tname = 'posts_table_name'; $link = mysql_connect($hostname, $username, $password); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db($dbname); // $res = mysql_query("SELECT ID, post_date, post_title, guid, DATE_FORMAT(post_date,'%Y%m%d') As pdate FROM " . $tname . " WHERE post_status='publish' ORDER BY post_date DESC"); if ($res == 0) { echo("Error " . mysql_errno() . ": " . mysql_error() . ""); } else if (mysql_num_rows($res) == 0) { echo("Query executed successfully"); } else { $j = 1; while (($r_array = mysql_fetch_row($res))) { $retval .= "\n"; if (($j % 19) == 0) { $retval .= "\n"; } $j++; } } mysql_close($link); $newhtml = $retval; if (file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html")) { if (!file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html_original")) { copy(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html",str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html_original"); } $whtml = str_replace("", $earr[3]); $newhtml = $earr[0] . "" . $retval . "", $earr[3]); $newhtml = $earr[0] . "" . $retval . "