$search = addslashes(htmlspecialchars($_POST['search']));
$section = $_POST['section'];
>>> I DO THIS NEXT BIT CAUS THE CATEGORIES IN THE DB ARE IN NUMBERS NOT WORDS <<<
if($section == "PHP"){
$section = 1;
}
if($section == "HTML"){
$section = 2;
}
if($section == "Tips and Tricks"){
$section = 3;
}
if($section == "Photoshop"){
$section = 4;
}
if($section == "Other"){
$section = 5;
}
if($section == "MySql"){
$section = 6;
}
if($section == "Javascript"){
$section = 7;
}
if($section == "CSS"){
$section = 8;
}
if($section == "Flash"){
$section = 10;
}
if($section == "3Ds Max"){
$section = 14;
}
if($section == "Maya"){
$section = 15;
}
if($section == "Dreamweaver"){
$section = 17;
}
if($section == "ASP"){
$section = 18;
}
if($section == "Visual Basic"){
$section = 19;
}
if($section == "Cinema 4D"){
$section = 20;
}
if($section == "Paintshop Pro"){
$section = 21;
}
if($section == "Fireworks"){
$section = 22;
}
if($section == "Imageready"){
$section = 23;
}
if($section == "C++"){
$section = 24;
}
if($section == "After Effects"){
$section = 25;
}
if($section == "Premiere"){
$section = 26;
}
$query2 = mysql_query("SELECT * FROM tutorial WHERE approved='approved' AND category='%$section%' AND title LIKE '%$search%' OR description LIKE '%$search%'");
$check1 = mysql_num_rows($query2);
if($check1 == 0){
echo "Please Check back Soon! <br> There are no tutorials yet!";
} else {
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0' style='border-collapse: collapse'>
<tr>
<td width='2%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'><b> </b></td>
<td width='30%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'><b>Tutorial & Description</b></td>
<td width='1%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'></td>
<td width='30%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'><b> Rating & Difficulty</b></td>
<td width='1%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'></td>
<td width='1%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'></td>
<td width='15%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'><b>Author</b></td>
<td width='10%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'><b>Views </b></td>
<td width='5%' class='formcontent' style='border-bottom: 1px #BBBBBB solid;'></td>
<tr><td> </td></tr>
</tr>";
while($b = mysql_fetch_array($query2)) {
(code for displaying tutorials - i knw there are no mistakes here)
}
echo "</table>";
}
and basically, it works, but it shows up tutorials from the wrong categories...
i was hoping if u could help me,
thx,
Joe
