It still didn't work and my server logs aren't giving me errors.
Here is my modified code:
<?php require("./db_mysql.inc.php");
$DB_NAME = "hidden";
$DB_USER = "hidden";
$DB_HOST = "hidden";
$DB_PASS = "hidden";
$db = new Db();
$db->DbConnect($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);?>
<html>
<head>
<title>Untitled</title>
</head>
<?php
$contest="promo";
$query = "select * from contests where ContestName='$contest'";
$Results=mysql_query($query);
$fp = fopen("contest.txt", "w")
while(list($Results)=mysql_fetch_array($query))
{
fwrite ($fp, $rows[*])
};
?>
And still it doesn't work, but the above shouldn't have any errors.
And yes, lol, I am connected to a database.