So recently I've been told that I should be using the new MySQLi instead of MySQL syntax. I had a quick look online and on the php manual but couldn't really find anything to help.
If I was to do this in MySQL:
<?php
$db = mysql_connect("localhost" , "root", "") or die("Check connection parameters!");
mysql_select_db("testdb", $db) or die(mysql_error($db));
$query = "SELECT * FROM entries";
$result = mysql_query($query) or die(mysql_error($db));
while($row = mysql_fetch_assoc($result)) {
echo "$row['author']";
echo "$row['content']";
}
?>
How would I do this in MySQLi?
Also someone was telling me about another type of database connection I think it was called PDO. What's the difference between this and the other two and which one should I be using?
Thanks!