barkermn01
08-02-2008, 11:38 PM
i this script now it is supposed to be a search
<?php
$i = 0;
$readin = '+'.$_GET['Search'];
$words = explode("+", $readin);
$max = count($words) - 1;
while($i != $max)
{
$sql = "SELECT * FROM `pages` where `keywords` LIKE '%".$words[$i]."%' LIMIT 0,10";
$query = mysql_query($sql, $con);
while($row = mysql_fetch_array($query))
{
echo' <table width="409" border="0">
<tr>
<td><a style="color: #4A912B;" href="http://www.brook-babes.org.uk/'.$row['link'].'">BrookBabes: '.$row['title'].'</a></td>
</tr>
<tr>
<td>'.$row['Content'].'</td>
</tr>
<tr>
<td><h6>http://www.brook-babes.org.uk/'.$row['link'].'</h6></td>
</tr>
</table>';
}
$i++;
}
$row = mysql_fetch_array($query);
if($row['id'] > 10)echo 'Not found what you were looking for <br> try refining your search';
?>
but for some reason this outputs all it can from my DB even with goboldy gook in there but if i change this$readin = '+'.$_GET['Search']; to $readin = ''.$_GET['Search']; i dont get any results yet of the tutorials i have read it sould work can any one help please
<?php
$i = 0;
$readin = '+'.$_GET['Search'];
$words = explode("+", $readin);
$max = count($words) - 1;
while($i != $max)
{
$sql = "SELECT * FROM `pages` where `keywords` LIKE '%".$words[$i]."%' LIMIT 0,10";
$query = mysql_query($sql, $con);
while($row = mysql_fetch_array($query))
{
echo' <table width="409" border="0">
<tr>
<td><a style="color: #4A912B;" href="http://www.brook-babes.org.uk/'.$row['link'].'">BrookBabes: '.$row['title'].'</a></td>
</tr>
<tr>
<td>'.$row['Content'].'</td>
</tr>
<tr>
<td><h6>http://www.brook-babes.org.uk/'.$row['link'].'</h6></td>
</tr>
</table>';
}
$i++;
}
$row = mysql_fetch_array($query);
if($row['id'] > 10)echo 'Not found what you were looking for <br> try refining your search';
?>
but for some reason this outputs all it can from my DB even with goboldy gook in there but if i change this$readin = '+'.$_GET['Search']; to $readin = ''.$_GET['Search']; i dont get any results yet of the tutorials i have read it sould work can any one help please