All I can do is expand on what ammcom already told you. Do something like this:
[PHP]
if (!$dbh = mysql_connect ("localhost", "myusername", "mypassword")) {
die ('I cannot connect to the database because: ' . mysql_error());
}
if (!$ret = mysql_select_db ("ababoc_filmlistings")) {
die("db selection failed: ".$mysql_error());
}
$sql = 'SELECT DISTINCT title FROM Listing LIMIT 0, 30 ';
echo "".$sql."\n";
if (!$rs = mysql_query($sql)) {
die("db query failed: ".mysql_error());
}
if (!$row = mysql_fetch_row($rs)) {
die("mysql fetch failed: ".mysql_error());
}
echo $row[0];
[/PHP]
If you get an error regarding the query failing, copy and pasted the SQL statement and run it directly against the database--making sure you choose "ababoc_filmlistings" as your db.