hi nice ya , am not getting any error , that's main problem , even no
browser script error , working in FF browser ,

Little bit i moved to another code ,

$(document).ready(function(){

$("#username").keyup(function(){
var username = $("#username").val();
$.getJSON('getinfo.php', {'id' : username}, parseInfo);
});

    // this function parses the fetched data into the 'info' paragraph
    function parseInfo(data)
    {
        alert(print_r(data));
        // the data parameter is an object, while name and email are the
keys from the PHP array
        // you can also use the 'text' function instead of html. The
difference is that 'text'
        // displays raw text, even if it contains other HTML elements.
        $('#info').html(data.name +', '+ data.email);
    }
});


*getinfo.php*


mysql_connect("localhost","root","admin");
mysql_select_db("test");
$keyword=(isset($_GET['id']) && !empty($_GET['id'])) ? $_GET['id'] : 0;

$sqlQuery = "SELECT * FROM users WHERE username like '%$keyword%'";
$result = mysql_query($sqlQuery);
$item = array();
while($row=mysql_fetch_object($result)){

    $username = $row->username;
    $userid   = $row->userid;
    $item = array("userid"=>$userid,"username"=>$username);
}
echo json_encode($item);

print_r($item);


now am thing ing how to return result  to form.php ....

Thanks





On Mon, Jun 29, 2009 at 6:04 PM, MorningZ <morni...@gmail.com> wrote:

>
> Is there any sort of error shown by Firebug or Fiddler?  or are you
> hoping for help on just "doesn't work"
>
>
> On Jun 29, 7:18 am, bharani kumar <bharanikumariyer...@gmail.com>
> wrote:
> > Hi alll
> >
> > $(document).ready(function(){
> >
> > $("#postcode").keyup(function(){
> > var txtvalue = $("#postcode").val();
> > alert(txtvalue)
> > $.ajax({
> >   method:"POST",
> >   url: "data.php",
> >   data:"txtvalue="+txtvalue,
> >   dataType: "json",
> >  success: function(data) {
> >     // Go do this, go do that…
> >     alert(data);
> >
> > }});
> > });
> > });
> >
> > This is my code ,
> >
> > data type:json not working ,
> >
> > Please tell me Why?
> >
> > Thanks
>



-- 
Regards
B.S.Bharanikumar
http://php-mysql-jquery.blogspot.com/

Reply via email to