Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/02/2011, 07:43
Avatar de ronnyra
ronnyra
 
Fecha de Ingreso: diciembre-2009
Mensajes: 173
Antigüedad: 14 años, 5 meses
Puntos: 1
ayuda con plugins de Raiting

hola amigos estoy usuado un plugin de jquery llamado jraiting mi pregunta es como puedo hacer para conectarme a mi bd mysql que tablas tengo que crear ???, creo que es por este archivo pero no lo entiendo muy bien...

Código PHP:
<?php
$aResponse
['error'] = false;
$aResponse['message'] = 'No se ha conectado al servidor';

// ONLY FOR THE DEMO, YOU CAN REMOVE THIS VAR
    
$aResponse['server'] = ''
// END ONLY FOR DEMO
    
    
if(isset($_POST['action']))
{
    if(
htmlentities($_POST['action'], ENT_QUOTES'UTF-8') == 'rating')
    {
        
/*
        * vars
        */
        
$id intval($_POST['idBox']);
        
$rate floatval($_POST['rate']);
        
        
// YOUR MYSQL REQUEST HERE or other thing :)
        /*
        *
        */
        
        // if request successful
        
$success true;
        
// else $success = false;
        
        
        // json datas send to the js file
        
if($success)
        {
            
$aResponse['message'] = 'Your rate has been successfuly recorded. Thanks for your rate :)';
            
            
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
                
$aResponse['server'] = '<strong>Success answer :</strong> Success : Your rate has been recorded. Thanks for your rate :)<br />';
                
$aResponse['server'] .= '<strong>Rate received :</strong> '.$rate.'<br />';
                
$aResponse['server'] .= '<strong>ID to update :</strong> '.$id;
            
// END ONLY FOR DEMO
            
            
echo json_encode($aResponse);
        }
        else
        {
            
$aResponse['error'] = true;
            
$aResponse['message'] = 'An error occured during the request. Please retry';
            
            
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
                
$aResponse['server'] = '<strong>ERROR :</strong> Your error if the request crash !';
            
// END ONLY FOR DEMO
            
            
            
echo json_encode($aResponse);
        }
    }
    else
    {
        
$aResponse['error'] = true;
        
$aResponse['message'] = '"action" post data not equal to \'rating\'';
        
        
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
            
$aResponse['server'] = '<strong>ERROR :</strong> "action" post data not equal to \'rating\'';
        
// END ONLY FOR DEMO
            
        
        
echo json_encode($aResponse);
    }
}
else
{
    
$aResponse['error'] = true;
    
$aResponse['message'] = '$_POST[\'action\'] not found';
    
    
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
        
$aResponse['server'] = '<strong>ERROR :</strong> $_POST[\'action\'] not found';
    
// END ONLY FOR DEMO
    
    
    
echo json_encode($aResponse);
}
ojala me puedan ayudar gracias de ante mano