Hallo,
Ik heb dus een zoeksysteem, het werkt bijna zoals ik het wil. Als ik in mijn database dit heb:
______________
Naam
Test
Test1
Test2
Test3
Lalal
_______________
En ik zoek op: Test, dan krijg ik alleen maar 'Test', en niet Test1, Test2, Test3 .. Ik heb gezien / gelezen dat ik de % moest aanpassen, maar ik heb ze allemaal geprobeerd zonder enige effect. Hopelijk is mijn vraag duidelijk.
[code]
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$zoekterm = mysql_real_escape_string(addslashes(trim($_POST['zoekterm'])));
$sql = "SELECT * FROM PlayerInfo WHERE user LIKE '$zoekterm%'";
$result = mysql_query($sql);
$row = mysql_fetch_array( $result );
{ ?>
<table id="table1" class="gtable sortable">
<thead>
<th class="first" width="5">
<a href="http://www.dawn-tdm.com/UCP/psummary.php?sort=1">#</a>
</th>
<th width="700">
Name
</th>
<th width="250">
<a href="http://www.dawn-tdm.com/UCP/psummary.php?sort=3">Score</a>
</th>
<th width="99">
<a href="http://www.dawn-tdm.com/UCP/psummary.php?sort=2">Cash</a>
</th>
<th width="5">
<a href="http://www.dawn-tdm.com/UCP/psummary.php?sort=4">Wins</a>
</th>
<th class="last" width="5">
<a href="http://www.dawn-tdm.com/UCP/psummary.php?sort=5">Muted</a>
</th>
</thead> <?php
echo'<tr class="bg2">';
echo'<td class="first">';
echo $row['ID'];
echo'</td>';
echo'<td title="">';
echo "<a href=\"http://www.Dawn-tdm.com/UCP/profile.php?id=$row[ID]\">$row[user]</a> ";
echo'<td>';
echo $row['Score'];
echo'<td title="">';
echo "$"; echo $row['Cash'];
echo'<td title="">';
echo $row['Wins'];
echo'<td class="last">';
if ($row['Muted'] == "0")
{
echo'No';
}
else if ($row['Muted'] == "1")
{
?><b><?php echo'Yes'; ?></b><?php
}
echo'</td>';
echo'</tr>';
echo'</table>';
}
}
1.695 views