Cytat(delfinium @ 14.07.2007, 11:06:13 )

Mistrzu ale ten kod nie przeszukuje artykułów tylko uaktualnia statystyki przeszukiwań względem szukanej frazy. Jeśli taka fraza była już szukana to zwiększa licznik o 1 a jeśli po raz pierwszy to dodawany jest nowy rekord. Gdzie tu masz przeszukiwanie artykułów?
to musialo mi sie cos pomylic :/
Macie caly skrypt

moze sie da cos zrobic?

<?php
$sql = "select * from search_terms where term = '$searchingred'";
$count = $row[1];
$newcount = $count + 1;
$sql = "update search_terms set count = $newcount where term = '$searchingred'";
} else {
$sql = "insert into search_terms (term, count) values ('$searchingred', 1)";
}
?>
<TD align="left" valign="top" bgcolor="#DEDDDC">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td valign="top">
<TABLE width=100% cellpadding=5 cellspacing=0 border=0>
<tr><td width=500 align=center>
<table cellpadding=1 cellspacing=1 border=0><tr><td bgcolor=#000000 width=500 height=20 valign=center align=center>
<table cellpadding=0 cellspacing=0 border=0><tr><td bgcolor=#cccccc width=498 height=18 valign=center align=left>
<font face="Arial, Helvetica, sans-serif" size="3"><b>Wyniki</b></font>
</td></tr></table>
</td></tr></table>
</td></tr>
<TR>
<TD valign=top>
<p><center><FONT face="Arial, Helvetica, sans-serif" size=2>Wszystkie tipsy zawierające słowo '</font><FONT face="Arial, Helvetica, sans-serif" size=2 color=red>
<?php printf($searchingred); ?></font><FONT face="Arial, Helvetica, sans-serif" size=2>'</center></p>
<table cellspacing=0 cellpadding=2 border=0>
<tr>
<th width=300 bgcolor=#bbbbbb align=center><FONT face=arial size=2>Nazwa</font></th>
<th width=85 bgcolor=#bbbbbb align=center><FONT face=arial size=2>Data dodania</font></th>
<th width=75 bgcolor=#bbbbbb align=center><FONT face=arial size=2>Ocena</font></th>
</tr>
<?php
$sql = "select tipid from tips where tip like '% $searchingred %' and status = 'L'";
$tipcount = 0;
do {
$tipid[$tipcount] = $myrow["tipid"];
$tipcount++;
}
if (count($tipid) == 0
) {
printf("<tr><td colspan=3><p><center><FONT face=arial size=2><b>Niestety nic nie znaleziono</b></font></center></p></td></tr>");
} else {
$rowcolor = 1;
for ($d = 0; $d < count($tipid); $d++) {
$sql = "select tipid, title, date, rating from tips where tipid = $tipid[$d]";
do {
if ($rowcolor == 1) {
$rowcolorhex = "#ffffff";
$rowcolor = 0;
} else {
$rowcolorhex = "#dddddd";
$rowcolor = 1;
}
printf("<td width=300 bgcolor=%s align=center><FONT face=arial size=2><a href=tip.php?tipid=%s>%s</a></font></td>", $rowcolorhex, $myrow["tipid"], $myrow["title"]); printf("<td width=80 bgcolor=%s align=center><FONT face=arial size=2>%s</font></td>", $rowcolorhex, $myrow["date"]); printf("<td width=75 bgcolor=%s><table bgcolor=%s border=0 cellspacing=0 cellpadding=0><tr>", $rowcolorhex, $rowcolorhex);
$onstars = round($myrow["rating"]); $offstars = 5 - $onstars;
for ($i = 1; $i <= $onstars; $i++) {
printf("<td width=15 bgcolor=%s align=center valign=center><FONT face=arial size=2><img src=images/staron2.gif></font></td>", $rowcolorhex); }
for ($f = 1; $f <= $offstars; $f++) {
printf("<td width=15 bgcolor=%s align=center valign=center><FONT face=arial size=2><img src=images/staroff2.gif></font></td>", $rowcolorhex); }
}
}
}
?>