note 82262 deleted from function.mysql-query by tularis
| From: | tularis@php.net | Date: | Thu, 03 Apr 2008 11:15:42 +0000 |
| Subject: | note 82262 deleted from function.mysql-query by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137886@lists.php.net to get a copy of this message | ||
Note Submitter: marquerodin at sneerscripts dot com
Reason: useless
----
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Persons who are in Que for being a DJ</title>
</head>
<body>
<table width="100%" border="1" bgcolor="Silver">
<tr bgcolor="White">
<td><div align="center">Applicants Full Name</div></td>
<td><div align="center">Applicants E-Mail</div></td>
<td><div align="center">DJ Name</div></td>
<td><div align="center">Speed Test Link</div></td>
<td><div align="center">View?</div></td>
<td><div align="center">Edit & Approve?</div></td>
</tr>
<?php
// return query result into array
function db_result_to_array($result)
{
$res_array = array();
for ($count=0; $row = @mysql_fetch_array($result); $count++)
$res_array[$count] = $row;
return $res_array;
}
function html_table_create() //will cycle creating row after row in the html table of the folks in
que
{
$dbHost = '';
$dbUser = '';
$dbPassword = '';
$dbSchema = ''; //Que Database
mysql_connect($dbHost,$dbUser,$dbPassword) or die("Connect Failed. Error Number(
<b>".mysql_errno()."</b> )<br>\n\r
Error:".mysql_error()."\n\r");
mysql_select_db($dbSchema) or die("Select Failed. Error Number(
<b>".mysql_errno()."</b> )<br>\n\r
Error:".mysql_error()."\n\r");
$query = "SELECT id, applicantsFullName, applicantsEmail, djName, speedTestLink FROM djapp_que
ORDER BY applicantsFullName";
$result = @mysql_query($query);
$result = db_result_to_array($result);
foreach ($result as $row)
{
echo "<tr>\r\n";
echo "<td>" . $row['applicantsFullName'] . "</td>\r\n";
echo "<td>" . $row['applicantsEmail'] . "</td>\r\n";
echo "<td>" . $row['djName'] . "</td>\r\n";
echo "<td><a href=\"" . $row['speedTestLink'] . "\"
target=\"_BLANK\">" . $row['speedTestLink'] .
"</a></td>\r\n";
echo "<td><a href=\"viewEdit/view.php?id=" . $row['id'] .
"\"> View? </a></td>\r\n";
echo "<td><a href=\"viewEdit/edit.php?id=" . $row['id'] .
"\"> Edit & Approve? </a></td>\r\n";
echo "</tr>\r\n";
}
mysql_free_result($query);
}
?>
<?php echo html_table_create(); ?>
</table>
</body>
</html>