If I enter the data in English, then I get a satisfactory answer when entering Russian letters, I get a list of all columns, and not the desired value. Name

The address where I implement this code http://royality.xyz/phptest3/index.php

<?php mysql_connect("localhost","user","pass") or die("could not connect"); mysql_select_db("base") or die("could not find db!"); mysql_query ("set_client='utf8'"); mysql_query ("set character_set_results='utf8'"); mysql_query ("set collation_connection='utf8_general_ci'"); mysql_query ("SET NAMES utf8"); $output = ''; if(isset($_POST['search'])) { $searchq = $_POST['search']; $searchq = preg_replace("#[^0-9a-z]#i","",$searchq); $query = mysql_query("SELECT * FROM medical WHERE name LIKE '%$searchq%' ") or die ("could not search"); $count = mysql_num_rows($query); if($count == 0){ $output = 'There was no search results!'; }else{ while($row = mysql_fetch_array($query)){ $name = $row['name']; $manufacturer = $row['manufacturer']; $id = $row['id']; $description = $row['description']; $output .= '<div>'. $name .' '. $manufacturer.' '. $description.'</div>'; } } } ?> <html> <head> <title>Search</title> </head> <body> <form method="post" action="index.php"> <input type="text" name="search" placeholder="search for members..." onkeydown="searchq();" /> <input type="submit" value=">>" /> </form> <?php print("$output"); ?> </body> </html> 
  • The coding in the name field is what? - Nikita Umnov
  • me more where you found mysql_connect? no one uses it already. At the worst there is - mysqli_connect - Paul Wall
  • In name coding cp1251_general_ci - Bogdan Scalius
  • change to utf8_general_ci - Nikita Umnov
  • Nothing has changed ( - Bogdan Scalius

0