Постю код
| Код | <?php include("connect.php");
$user_region = $_REQUEST["region"]; if ($user_region != "") { //$user_region = htmlspecialchars($user_region); $user_region = trim($user_region);
//indeed this is REALLY a magical string :)/////////////////////////////// //it converts ukrainian 'i' into latin 'i' making the search possible :)))) $user_region = strtr($user_region, "і", "i"); $user_region = strtr($user_region, "Ї", "Ї"); //$user_region = strtr($user_region, "'", "'"); ///////////////////////////////////////////////////////////////////////////
//print($user_region); print("<br>"); $user_region = $user_region."%"; //print($user_region); print("<br>"); $SqlText = "Select * FROM dov_koatuu WHERE NU LIKE '$user_region'"; print($SqlText); print("<br>"); $result = mysql_query($SqlText) or die("Error occurred in query request :( " . mysql_error());
?>
<html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> </head> <body> <table border=1> <tr> <td>КОАТУУ</td> <td>Название</td> </tr>
<?php while ($array = mysql_fetch_array($result)) { print("<tr>");
print("<td>"); print($array['TE']); print("</td>");
print("<td>"); print($array['NU']); print("</td>");
print("</tr>"); }
print substr($array['TE'], 0, 2); ?> </table> <br> <a href='sort.php'>Назад</a> <?php }//if else{ print("Вкажіть критерій пошуку!"); ?>
<br> <a href='sort.php'>Назад</a>
<?php }//else?> </body> </html>
|
Фляга! В натуре $array['TE'] пустая. Почему? |