This is the code:

if($_GET['find']){ $text=$_GET['text']; $text=preg_replace("#[^0-9a-z]#i","",$text); $query=mysql_query("SELECT * FROM student WHERE username LIKE '%$text%' OR surname LIKE '%$text%' OR name LIKE '%$text%' OR lastName LIKE '%$text%'") or die("netu"); $count=mysql_num_rows($query); if($count==0){ echo "<h2 style='font-size:22px;'>Ничего не найдено!</h2>"; }else if($count!=0){ while($row=mysql_fetch_array($query)){ $login=$row['username']; $surname=$row['surname']; $name=$row['name']; $lastName=$row['lastName']; echo "<tr>"; echo "<td class='num'>1</td>"; echo "<td class='log'><a href='../profile.php?=".$_GET['id']."'>".$login."</a></td>"; echo "<td class='fio'><p>".$surname." ".$name." ".$lastName."</p></td>"; if($admin){ echo "<td class='action'><a href='../deleteProfile.php'>Удалить</a></td>"; } echo "</tr>"; } }else{mysql_error();} } 

And this code searches for once, that is, the first time it is found, but if you try to find anything again, it returns the site without data, but the design remains

  • We can assume that this piece has nothing to do with it. And something happens for example with <form> on the page, the link does not lead there or some of these curves or the name of the input changes or something else is wrong. because the DB cannot search once and the other does not, something is wrong with the input parameters from the client - Mike

0