2017-09-01, 04:25 PM
(2017-09-01, 09:25 AM)Papergoddess Wrote: EVERYTHING IS DIFFERENT. PLEASE CAN YOU GIVE ME STEP BY STEP DETAILS ON HOW TO DO IT? THANK YOU
Fill out the connection details
$mysqli = new mysqli('localhost', 'root', 'password', 'dbname');
if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
}
This is where you change the prefix:$query3 = $mysqli->query("SELECT * FROM `wp_posts` WHERE `post_type` = 'post' LIMIT 0,5");
Change the details in the loop:
if ($query3->num_rows > 0) {
while ($result = $db->fetch_array($query3)) {
$data1 = $result['post_title'];
$data0 = $result['id'];
$date = $result['post_date'];
echo "<div class='row bootstrap snippets'>
<div class='col-md-9 col-sm-7'>
<h2><a href='/personal/".$result[post_name]."'>$data1</a> <small>$date</small> $data0</h2>
</div> ";
echo "</div>";
}
}
else {
echo "<h2>Sorry Nothing Found</h2>";
}
if you still need help or such just reply.
The mysqli is the new way of connecting to the database. This will open up another connection to a different database