note 82262 added to function.mysql-query
| From: | marquerodin at sneerscripts dot com | Date: | Thu, 03 Apr 2008 06:35:35 +0000 |
| Subject: | note 82262 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137880@lists.php.net to get a copy of this message | ||
<!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>
----
Server IP: 64.71.164.2
Probable Submitter: 68.112.71.197
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- https://master.php.net/note/edit/82262
Del: integrated -- https://master.php.net/note/delete/82262/integrated
Del: useless -- https://master.php.net/note/delete/82262/useless
Del: bad code -- https://master.php.net/note/delete/82262/bad+code
Del: spam -- https://master.php.net/note/delete/82262/spam
Del: non-english -- https://master.php.net/note/delete/82262/non-english
Del: in docs -- https://master.php.net/note/delete/82262/in+docs
Del: other reasons-- https://master.php.net/note/delete/82262
Reject -- https://master.php.net/note/reject/82262
Search -- https://master.php.net/manage/user-notes.php