Well to make it real simple and not worry about doing it the OO way (which you should learn, but the transition is easier if you just focus on moving libraries first IMO) you would just do it like this:
<?php
$db = mysqli_connect("localhost" , "root", "") or die("Check connection parameters!");
// Optionally skip select_db and use: mysqli_connect(host,user,pass,dbname)
mysqli_select_db($db,"testdb") or die(mysqli_error($db));
$query = "SELECT * FROM entries";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
while($row = mysqli_fetch_assoc($result)) {
echo "$row['author']";
echo "$row['content']";
}
To do the exact same thing the OO way:
<?php
$db = new mysqli('localhost','root','','testdb');
if( $db->connect_error ) {
die('Connect Error (' . $db->connect_errno . ') '
. $db->connect_error);
}
$query = "SELECT * FROM entries";
$result = $db->query($query);
if( !$result ) {
die('Query failed!<br>'.$db->error);
}
if( $result->num_rows == 0 ) {
die('No rows returned');
}
while( $row = $result->fetch_assoc() ) {
echo $row['author'];
echo $row['content'];
}
HTH