Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Pretraga - Cyrlica problem

[es] :: PHP :: Pretraga - Cyrlica problem

[ Pregleda: 1106 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

zezanje.co.yu

Član broj: 99979
Poruke: 72
217.169.210.*



Profil

icon Pretraga - Cyrlica problem02.03.2012. u 12:50 - pre 147 meseci
Pozdrav

Imam jedan problem posedujem scriptu za pretragu baze scripta je pisana u php & ajax kada setujem sve na latinicno pismo scripta radi super a kada prebacim na cyrlicu scripta nece da reaguje na tekst koji unsem u textfiled a na brojeve hoce. Problem je kada upisem PIB broj podatak dobijem iz pretrage ali kad unosim neko ime firme podatak ne mogu dobiti samo ispise da taj podatak ne stoji u bazi, a u bazi u istoj koloni se nalazi ime firme i pib broj.

Evo Koda ---

Konekcija

Code:
<?php
$conn = mysql_connect("localhost","root","") or die("NEMOGUCE USPOSTAVITI VEZU SA SERVEROM");
mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'");
 mysql_select_db("obrbaza",$conn) or die("NEMOGUCE USPOSTAVITI VEZU SA SERVEROM");

?>


- Index -

Code:
<html><head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Pretraga Pretmeta</title>

<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">

        function getScriptPage(div_id,content_id,get_count)
        {
            subject_id = div_id;
            content = document.getElementById(content_id).value;
            http.open("GET", "script_page.php?content=" + escape(content)+"&count="+get_count, true);
            http.onreadystatechange = handleHttpResponse;
            http.send(null);
        }    

</script>
<link href="styles.css" rel="stylesheet" type="text/css"></link>    
</head>

<body>
<div class="ajax-div">
    <div class="input-div">
    Unesite kljucnu rec za pretrgau :
    <input type="text" id="text_content" size="40" onKeyUp="getScriptPage('count_display','text_content','1')">
    <input name="Submit" type="submit" class="button" onMouseUp="getScriptPage('output_div','text_content','0')" value="Search">
        <div id="count_display">
           
        </div>
    </div>
    <div class="output-div-container">
    <div id="output_div">
    </div>
    </div>
    </form>
</div>
</body>
</html>


Script_page.php

Code:

<link rel="stylesheet" type="text/css" href="style.css" />
<html>
<head>

</head>
<body>
<?php
    // You can do anything with the data. Just think of the possibilities!
    include('conn.php');

    $strlen = strlen($_GET['content']);
    $display_count = $_GET['count'];
    
    $select = "select * from obr832012 where okrivljeni_ime_prezime like '%".$_GET['content']."%' ";
    
    $res = mysql_query($select);
    $rec_count = mysql_num_rows($res);
    if($display_count)
    {
      echo "There are <font color='red' size='3'>".$rec_count."</font> matching records found.Click Search to view result.";
    }
    else
    {
?>
    <center>   
    <table class="sofT" cellspacing="0" border="1">
    <tr>
        <td colspan="5" class="helpHed" align="center">Search Result</td>
    </tr>
    <tr>
       <td class='helpHed'>Redni_broj</td>
       <td class='helpHed'>IME I PREZIME</td>
       <td class='helpHed'>broj_zahteva</td>
       <td class='helpHed'>podnosilac_zahteva</td>
       <td class='helpHed'>datum_prijema</td>
    </tr>
<?php
    if($rec_count > 0)
    {
        while($data=mysql_fetch_array($res))
        { 
            echo "<tr>
                  <td class='sup'>".$data['redni_broj']."</td>
                  <td class='sup'>".$data['okrivljeni_ime_prezime']."</td>
                  <td class='sup'>".$data['broj_zahteva']."</td>
                  <td class='sup'>".$data['podnosilac_zahteva']."</td>
                  <td class='sup'>".$data['datum_prijema']."</td>
                 </tr>";
        }
    }
    else
        echo '<td colspan="5" align="center"><FONT SIZE="2" COLOR="red">No matching records found....!</FONT></td>';
  }
?>
</center>





Prikačeni fajlovi
 
Odgovor na temu

PHPovac

Član broj: 300013
Poruke: 168
*.dynamic.isp.telekom.rs.



+19 Profil

icon Re: Pretraga - Cyrlica problem03.03.2012. u 21:25 - pre 147 meseci
Encoding promeni iz utf8_general_ci u utf8_unicode_ci (http://forums.mysql.com/read.php?103,187048,188748#msg-188748)
 
Odgovor na temu

[es] :: PHP :: Pretraga - Cyrlica problem

[ Pregleda: 1106 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.