If you've done Pascal you'll pick it up in three days. PHP is more like a munging of C and Bourne shell scripting with a few twists of its own.
There are some good tutorials on working with databases here and at webmonkey. Most people use one of the database-specific libraries, so the actual function calls will differ depending on whether you're using MySQL, Postgres, etc., but the basic technique is pretty much the same:
Log into the DBMS and select the database.
Send a query, which returns a result set.
Repeatedly call a "fetch" function, passing it the result set handle, until the well runs dry. On each successful call, do something interesting with the results.
// connect
mysql_connect("localhost", "username", "password");
mysql_select_db("somedatabase");
// issue a query
$result = mysql_query("select * from mytable order by somecolumn");
// print out a label and start a table
echo "<h1>This is a table of results</h1>";
echo "<table>\n";
// repeatedly print out rows
while ($row = mysql_fetch_object($result))
{
echo "<tr><td> $row->somecolumn</td>
<td>$row->anothercolumn</td></tr>";
}
// close the table
echo "</table>";
That's pretty much all there is to it. If you want to print out part of a result set (i.e., items 1 through 10, 11 through 20, et cetera), you would append a LIMIT clause to the SQL statement:
select * from mytable order by somecolumn limit 10,20