Here, I'll show you how I was able to search, format and display all the information:
$search=$_POST["search"];
$level = $_POST["level"];
$type = $_POST["type"];
//get the mysql and store them in $result
$result = mysql_query("SELECT * FROM Resources WHERE level LIKE '%$level%' AND (tags LIKE '%$search%' or name LIKE '%$search%') AND type LIKE '%$type%' ORDER BY date DESC ");
//grab all the content
while ($get_info = mysql_fetch_array($result)){
$series[] = array('name' => $get_info['name'], 'url' => $get_info['url'], 'tags' => $get_info['tags'], 'level' => $get_info['level'], 'submittedby' => $get_info['submittedby'], 'date' => $get_info['date']);
}
?>
<!-- Show Content -->
<p>Here are all the resources...</p>
<?php foreach ($series as $show): ?>
<blockquote>
<h2><?php echo htmlspecialchars($show['name'], ENT_QUOTES, 'UTF-8'); ?></h2>
<p><em><a href="http://www.tracyr.comlu.com/SFVT/upload/<?php echo htmlspecialchars($show['url'], ENT_QUOTES, 'UTF-8'); ?>">click to download file </a></em><br/>
Tags:
<em><?php echo htmlspecialchars($show['tags'], ENT_QUOTES, 'UTF-8'); ?></em><br/>
Submitted By:
<em><?php echo htmlspecialchars($show['submittedby'], ENT_QUOTES, 'UTF-8'); ?></em><br/>
Date added: <?php echo htmlspecialchars($show['date'], ENT_QUOTES, 'UTF-8'); ?>
</p></blockquote>
<?php endforeach; ?>
Basically, the code allows me to grab all of the content from the db- if I want to filter it using the search form, that's where this comes in:
WHERE level LIKE '%$level%' AND (tags LIKE '%$search%' or name LIKE '%$search%') AND type LIKE '%$type%'
The second part of the code allows me to format the results by fetching the array and mixing html and php to decide how each result displays. It also allows me to create the url of each file since they are all in the /upload folder and the filename comes from the database.
This all took me a little while to get working- especially understanding the fetch array and "for each..." sections. But got there in the end!