Skip to content Skip to sidebar Skip to footer

Get All Values From Mysql Then Make Variables

Hi i want to get values from PHP files and make them usuable like array. I'm using jquery. How should i format retriever and php file to retrieve them all. PHP file: i used switch

Solution 1:

Use JSON. In your PHP file, just output:

echo json_encode($gracz);

And change your ajax handler to accept json data:

$.ajax({   
    type:   "POST",
    async:  false,   
    url:    "char_info2.php",   
    data:  { name: merk },   
    dataType: "json",  
    success:  function(data) {
        // Use data.max_pz or whatever here
    } 
}); 

Post a Comment for "Get All Values From Mysql Then Make Variables"