Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

raj2005 on "want to link the posts on mywebsite back to it's own website where they live"

$
0
0

Hi I managed to fix this now for anyone else that may have the same error. I just hardlinked the link:

<?php

$mydb = new wpdb('root','','test','localhost');
$rows = $mydb->get_results("select post_title from wp_posts WHERE post_status='publish'");
echo '<ul>';
foreach ($rows as $obj) : ?>

   <li><a href="http://localhost/database2/2015/11/26/<?php echo $obj->post_title; ?>"><?php echo $obj->post_title; ?></a></li>

<?php
endforeach;
echo '</ul>';

?>

Viewing all articles
Browse latest Browse all 5527

Trending Articles