calling php function in jquery
<p>I have one file json.js and one php function in php file .in json.js i want to check value returned by php function  if value returned by fucntion is 0 jquery should perform :$(':input').prop('disabled', true); otherwise nothing –</p>

<pre><code>function loadJson (table, id) {

    $.get("json-object.php", {'table': table, 'id':id}, function (data) {


        console.log(data);

        $.each(data, function (k, v) {
            if ($('input[name="'+k+'"]').is('input[type="text"]')) {
                $('input[name="'+k+'"]').val(v);
            } 
            if($('select[name="'+k+'"]').val(v)){
                get_input_value(k,v);   

            } 


            if ($('input[name="'+k+'"]').is('input[type="checkbox"]')) {
                get_input_value(k,v);
            } 
         console.log(k+' ==&gt; '+v);


        // Here I want to check condition of php function if value returned by fucntion is 0 it should perform :$(':input').prop('disabled', true); otherwise nothing //
        });
    }, 'json');
}
</code></pre>

<p>My php function:</p>

<pre><code>function ronly($id) {

    //$id=$_POST['noces'];
    $sql = "SELECT COUNT(noces) FROM alterdetail WHERE noces = '$id'";
    $sql.=';';
    //echo "QUERY &lt;br/&gt;";
    //echo $sql;
    $res = mysql_query($sql);
    $row = mysql_fetch_array($res);

           if($row['COUNT(noces)'] &gt; 0)
                { echo "you can not alter data";
                return 0;
                }
                else
                {
                    echo "   data new  ";
                return 1;
                }
   }    
</code></pre>
