$x=0;
while(Query result blabla){
$y=0;
while($y!=5){
array[$x][$y]=$result[$y];
$y++;
}
$x++;
}
print like
> <tr>
> <td>arrray[1][1]</td>
> <td>arrray[1][2]</td>
> <td>arrray[1][3]</td>
> <td>arrray[1][4]</td>
> </tr>
> <tr>
> <td>arrray[2][1]</td>
> <td>arrray[2][2]</td>
replace numbers by variabels
etc
"daan" <da...@laatmaar.nu> schreef in bericht
news:zmKK8.1648$cP3.1...@amsnews02.chello.com...
<html>
<title>Search Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253">
<LINK REL="STYLESHEET" HREF="digi_style.css" TYPE="text/css">
<style type="text/css">
<!--
.searchcss1 { font-family: Arial, Helvetica, sans-serif; font-size: 9px;
font-style: normal; line-height: normal; font-weight: normal; font-variant:
normal}
-->
<!--
body { background-attachment: fixed; background-image:
url(images/backgrounddownloads.jpg); background-repeat: no-repeat;
background-position: left top}-->
kground-position: left top}
</style>
</head>
<body bgcolor="#CECCCD" text="#000000" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0">
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
</html>
<?
function pagenav() {
global $limit,$offset,$numpage,$where;
if ($where) {
$safewhere=urlencode($where);
}
echo "
<TABLE CELLPADDING=0 BORDER=0 CELLSPACING=5 WIDTH=300>
<ALIGN=RIGHT>";
if ($offset>=$limit) {
$newoff=$offset-$limit;
echo "<A HREF=\"$PHP_SELF?offset=$newoff&where=$safewhere\">
<-- PREV</A>
";
} else {
echo "<-- PREV";
}
echo "<ALIGN=CENTER> ";
for ($i=1;$i<=$numpage;$i++) {
if ((($i-1)*$limit)==$offset) {
print "$i ";
} else {
$newoff=($i-1)*$limit;
echo "<A HREF=\"$PHP_SELF?offset=$newoff&where=$safewhere\">
$i</A> ";
}
}
echo "
<ALIGN=LEFT>";
if ($offset!=$limit*($numpage-1)) {
$newoff=$offset+$limit;
echo "<A HREF=\"$PHP_SELF?offset=$newoff&where=$safewhere\">
NEXT--></A>
";
}else{
echo "NEXT-->";
}
echo "
</TABLE>";
} // END FUNCTION
// number of results per page
$limit=3;
// if no offset has been passed, offset should be 0
if (!$offset) $offset=0;
if (!$where) {
//if (empty($search_query) || empty($searchCategory))
if(empty($searchCategory)) {
// Let's make sure they search for something
//
echo "Please go back and enter search criteria";
exit;
}
$where="$search_query|$searchCategory";
}
// I'm going to use a pipe to
// explode the array may need to change this later
$data=explode('|',$where);
if($data[0] == "" && $data[1] == 'fullsearch')
{
$query_where="";
}
elseif($data[0] == "")
{
$query_where="where category='$data[1]'";
}
elseif($data[1] != 'fullsearch')
{
$query_where="where description LIKE '%$data[0]%' AND category='$data[1]'";
} else {
$query_where="where description LIKE '%$data[0]%'";
}
// Connect to MySQL
$link = mysql_connect('host', 'username', 'password') or die(mysql_error());
// Select database
$db = mysql_select_db('mydb') or die(mysql_error());
$result=mysql_query("select count(*) from uploads $query_where");
list($numrec)=mysql_fetch_row($result);
$count = $numrec;
#calc num pages
$numpage=intval($numrec/$limit);
if ($numrec%$limit) {
$numpage++; // add one page if remainder
}
$result=mysql_query ("select * from uploads $query_where limit
$offset,$limit");
echo "<h1>Search Results</h1>";
echo "<b>Search for <font color = 'E10606'>$data[0]</font>".
" returned <font color = 'E10606'>$count</font> results</b><br><br>";
echo "<table border=1 class = searchcss1>\n";
echo "<tr><th bgcolor = \"#CCCCFF\">Uploaded By</td>
<th bgcolor = \"#CCCCFF\">Filename</td>
<th bgcolor = \"#CCCCFF\" width=40%>Description</td>
<th bgcolor = \"#CCCCFF\">Category</td>
<th bgcolor = \"#CCCCFF\"></td>
<tr>";
while($row = mysql_fetch_array($result))
{
if($row[3] == 'misc')
$row[3] = 'Miscellaneous';
if($row[3] == 'lingoprogram')
$row[3] = 'Lingo Programming';
if($row[3] == 'actionscript')
$row[3] = 'Action Scipting';
if($row[3] == 'director')
$row[3] = 'Macromedia Director';
if($row[3] == 'flash')
$row[3] = 'Macromedia Flash';
if($row[3] == '3dmodelling')
$row[3] = '3D Modelling';
if($row[3] == '3danimation')
$row[3] = '3D Animation';
if($row[3] == '3Dgames')
$row[3] = '3D Games';
echo "<tr><td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "<td>$row[2]</td>";
echo "<td>$row[3]</td>";
echo "<td><A HREF=$row[4]>Download</A></td>";
echo "</tr>";
// Loop through the $db->Records hash
//while(list($key, $value) = each($row))
//{
//}
//print("<p>");
}
// Only show the back and next links if number of return result is greater
then limit
if ($numpage>1) {
pagenav();
print "<P>";
}
?>
"daan" <da...@laatmaar.nu> wrote in message
news:zmKK8.1648$cP3.1...@amsnews02.chello.com...