<?php
echo $data['customers_lastname'].’ ‘.$data['customers_firstname'].’ AM : ‘.$data['customers_fax'].”;
?>
________________
I had to search with LATIN characters, because there was a problem with GREEK characters. So when LATIN characters are posted, they are replaced with GREEK characters. And wehen someone wants to search records with LATIN characters in database, he can use lowercase because I replace only upercase characters.
1 comment
I can’t pass the id in the hidden field. I put the function
function getSelectedId(text, li) {
$(’customers_fax’).value=li.id;
}
before my form, because if I put it after I take error because element getSelectedId is not yet set for the function Ajax.Autocompleter to call it.
But even I tried all the ways that I can think, I did not managed to get this work, to pass the id in a hidden input field.
My page code is :
function getSelectedId(text, li) {
$(’customers_fax’).value=li.id;
}
ÁíáæÞôçóç ÌÝëïõò :
new Ajax.Autocompleter(”search”,”hint”,”server.php”,{afterUpdateElement : getSelectedId});
And my server.php is :
$test_echo = $_POST['search'];
$test_echo = str_replace(”A”, “Á”, $test_echo);
$test_echo = str_replace(”B”, “”, $test_echo);
$test_echo = str_replace(”G”, “Ô, $test_echo);
$test_echo = str_replace(”D”, “Ä”, $test_echo);
$test_echo = str_replace(”E”, “Å”, $test_echo);
$test_echo = str_replace(”Z”, “Æ”, $test_echo);
$test_echo = str_replace(”H”, “Ç”, $test_echo);
$test_echo = str_replace(”U”, “È”, $test_echo);
$test_echo = str_replace(”I”, “É”, $test_echo);
$test_echo = str_replace(”K”, “Ê”, $test_echo);
$test_echo = str_replace(”L”, “Ë”, $test_echo);
$test_echo = str_replace(”M”, “Ì”, $test_echo);
$test_echo = str_replace(”N”, “Í”, $test_echo);
$test_echo = str_replace(”J”, “Δ, $test_echo);
$test_echo = str_replace(”O”, “Ï”, $test_echo);
$test_echo = str_replace(”P”, “Д, $test_echo);
$test_echo = str_replace(”R”, “Ñ”, $test_echo);
$test_echo = str_replace(”S”, “Ó”, $test_echo);
$test_echo = str_replace(”T”, “Ô”, $test_echo);
$test_echo = str_replace(”Y”, “Õ”, $test_echo);
$test_echo = str_replace(”F”, “Ö”, $test_echo);
$test_echo = str_replace(”X”, “×”, $test_echo);
$test_echo = str_replace(”C”, “Ø”, $test_echo);
$test_echo = str_replace(”V”, “Ù”, $test_echo);
$keywords = $test_echo;
$search_name = ” where customers_lastname like ‘%” . $keywords . “%’ or customers_fax = ‘” . $keywords . “‘”;
$search_name = $db->bindVars($search_name, ‘:keywords:’, $keywords, ‘regexp’);
$sql = “SELECT customers_fax, customers_lastname, customers_firstname
FROM customers
” . $search_name . ”
“;
$rs = mysql_query($sql);
?>
<li id =”" title=”" class=”lista_li”>
<?php
echo $data['customers_lastname'].’ ‘.$data['customers_firstname'].’ AM : ‘.$data['customers_fax'].”;
?>
________________
I had to search with LATIN characters, because there was a problem with GREEK characters. So when LATIN characters are posted, they are replaced with GREEK characters. And wehen someone wants to search records with LATIN characters in database, he can use lowercase because I replace only upercase characters.
Leave a Comment