Ver Mensaje Individual
  #12 (permalink)  
Antiguo 25/03/2010, 00:16
Avatar de Nemutagk
Nemutagk
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: México
Mensajes: 2.633
Antigüedad: 21 años
Puntos: 406
Respuesta: Necesito ayuda con script en PHP urgente

mmm, al parecer el error esta al ejecutar la sentencia SQL, cambia el siguiente codigo de la clase sql
Código PHP:
Ver original
  1. //Cambia esto...
  2. function query($query) {
  3.         if ($result = mysql_query($query,$this->connection))
  4.                  return $result;
  5.               die('MySQL Query Error...');
  6.         }
  7.  
  8. //Por esto
  9. function query($query) {
  10.        $result = mysql_query($query,$this->connection) or die ('Error MySQL: '.mysql_error());
  11.  
  12.        return $result;
  13. }

Tambien cambia....
Código PHP:
Ver original
  1. //Cambia esto....
  2.  $result = $mysql->query("SELECT `account_id`, `cash_points` FROM `login` WHERE `userid` = '$userid';");
  3.                 if( $data = $mysql->fetcharray($result) )
  4.                 {
  5.                         $account_id = $data['account_id'];
  6.                         $cash_points = $data['cash_points'];
  7.  
  8. //Cambia por esto otro...
  9.  $result = $mysql->query("SELECT `account_id`, `cash_points` FROM `login` WHERE `userid` = '$userid';");
  10. $data = $mysql->fetcharray($result);
  11.  
  12. if (count($data) != 0) {
  13.                         $account_id = $data['account_id'];
  14.                         $cash_points = $data['cash_points'];

Y por ultimo cambia

Código PHP:
Ver original
  1. //Cambia esto
  2. else
  3.                 {
  4.                         // Log Wrong SMS - Can be found with account_id = 0
  5.                         $mysql->query("INSERT INTO `smslog` (`account_id`, `userid`, `code`, `country`, `time`) VALUES ('0', '$userid', '$code', '$country', NOW())");
  6.                 }
  7.  
  8. //Por esto
  9. else
  10.                 {
  11.                         // Log Wrong SMS - Can be found with account_id = 0
  12.                         $mysql->query("INSERT INTO `smslog` (`account_id`, `userid`, `code`, `country`, `time`) VALUES ('0', '$userid', '$code', '$country', NOW())");
  13.                         echo 'Error!!!';
  14.                 }
Has los cambios que te digo y ve si te manda error...
__________________
Listo?, tendría que tener 60 puntos menos de IQ para considerarme listo!!!
-- Sheldon Cooper
http://twitter.com/nemutagk
PD: No contestaré temas vía mensaje personal =)