View Single Post
Old 12-15-2012, 05:09 AM   PM User | #1
Styles2304
New Coder

 
Join Date: Jul 2005
Posts: 84
Thanks: 4
Thanked 0 Times in 0 Posts
Styles2304 is an unknown quantity at this point
AJAX Request: Not properly retrieving data

Am I missing something? I get the alert stating that the function has indeed been called but apparently the rest is not successful . . . I don't get an alert with the json data in it.

PHP Code:
        function updateCreatureList() {
            
alert('called');
            $.
ajax({
                
type'GET',
                
url'scripts/php/process.php?mode=creatureList',
                
dataType'json',
                
success: function(data){
                    
alert(data);
                }
            });
        } 
here is the php in process.php if it matters
PHP Code:
    if ($_GET['mode'] == 'creatureList') {
        
$query "SELECT * FROM `creatures`";
        
$result mysql_query($query$link) or die(mysql_error());
        
$row mysql_fetch_array($result);

        echo 
json_encode($row);
    } 
Styles2304 is offline   Reply With Quote