Foros del Web » Programando para Internet » PHP »

Ayuda con error porfavor!

Estas en el tema de Ayuda con error porfavor! en el foro de PHP en Foros del Web. Hola, tengo el siguiente codigo Código PHP: <?php require( '../include/database_connection.php' ); session_start (); $ip = $_SERVER [ 'REMOTE_ADDR' ]; $username = $_POST [ 'username' ]; ...
  #1 (permalink)  
Antiguo 14/06/2009, 13:00
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Exclamación Ayuda con error porfavor!

Hola, tengo el siguiente codigo
Código PHP:
<?php

require('../include/database_connection.php');
session_start();
$ip=$_SERVER['REMOTE_ADDR'];
$username=$_POST['username'];
$password=$_POST['password'];

$securitycode='@$galvaxsecurity$@';
$encodedpass=md5($security.$password.$security);
$query"SELECT * FROM admin WHERE username=$username";
$result=mysql_db_query($database,$query,$conn) or die (mysql_error());


//We verify if the username eists.
if(mysql_num_rows($result)==0)
{
    

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Las Comas de Morales S.P.R. de R.S. - Sistema de Administracion</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
td img {display: block;}.Form_text {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: #000;
}
.links {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: #C90;
    text-decoration: underline;
}
a:hover {
    color: #FC0;
}
</style>
<!--Fireworks CS3 Dreamweaver CS3 target.  Created Sat Jun 13 21:38:00 GMT-0500 (CDT) 2009-->
</head>
<body bgcolor="#ffffff">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="website.png" fwpage="Login" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "1302912333" fwnested="0" -->
  <tr>
   <td><img src="../images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="108" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="285" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="108" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="149" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td colspan="5">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="48" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="2">&nbsp;</td>
   <td><img name="indexr2_c3r2_c3" src="../images/indexr2_c3r2_c3.jpg" width="285" height="123" border="0" id="indexr2_c3r2_c3" alt="" /></td>
   <td colspan="2">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="123" border="0" alt="" /></td>
  </tr>
  <tr>
   <td rowspan="4">&nbsp;</td>
   <td colspan="3"><img name="indexr3_c2r3_c2" src="../images/indexr3_c2r3_c2.jpg" width="501" height="34" border="0" id="indexr3_c2r3_c2" alt="" /></td>
   <td rowspan="4">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="34" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3" align="center" valign="middle">
   <?php
   $query_tries
="SELECT FROM tries where ip ='$ip'";
   
$result_tries=mysql_db_query($database,$query_tries,$conn) or die (mysql_error());
   
// If username doesnt exists, we verify if the clients ip is saved on the database, if not we insert it.
   
if(mysql_num_rows($result_tries)==0)
   {
        
$sql 'INSERT INTO tries (ip, tries, time)  
VALUES ("' 
$ip '",1, time());';
   }
   else
   {
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
$add_try=$tries+1;
    
$query_update_tries="UPDATE tries SET tries='$add_try'  where ip ='$ip'";   
   }
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
    
//We verify the number o login tries.
    
if($tries<3)
    {
    echo
'El usuario y/o contraseña ingresados no son corrrectos. Haga click <a href="index.php" target="_self" class="links">aquí</a> para regresar he intentar de nuevo. Usted ha utilizado '.$tries.' de los 3 intentos de ingreso. Por razones de seguridad, cuando haya usado los 3 intentos su cuenta será bloqueada por 15 minutos.';    
    }
   if(
$tries==3)
   {
       echo
' Usted ha ingresado el usuario y/o contraseña incorrectamente 3 veces seguidas. Por razones de seguridad, el sistema se bloqueara por 15 minutos. Le sugerimos que revise sus datos antes de ingresarlos para evitar esto en el futuro. Gracias.';
       exit();
   }
   

}
else
$array=mysql_fetch_array($result);
if(
$array['password']==$encondedpassword)
{
    
$_SESSION["username"]=$username;
    
$_SESSION["admin"]=$array['name'];
}
else
{
    
$query_tries="SELECT FROM tries where ip ='$ip'";
   
$result_tries=mysql_db_query($database,$query_tries,$conn) or die (mysql_error());
   
// If username doesnt exists, we verify if the clients ip is saved on the database, if not we insert it.
   
if(mysql_num_rows($result_tries)==0)
   {
        
$sql 'INSERT INTO tries (ip, tries, time)  
VALUES ("' 
$ip '",1, time());';
   }
   else
   {
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
$add_try=$tries+1;
    
$query_update_tries="UPDATE tries SET tries='$add_try'  where ip ='$ip'";   
   }
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
    
//We verify the number o login tries.
    
if($tries<3)
    {
    echo
'El usuario y/o contraseña ingresados no son corrrectos. Haga click <a href="index.php" target="_self" class="links">aquí</a> para regresar he intentar de nuevo. Usted ha utilizado '.$tries.' de los 3 intentos de ingreso. Por razones de seguridad, cuando haya usado los 3 intentos su cuenta será bloqueada por 15 minutos.';    
    }
   if(
$tries==3)
   {
       echo
' Usted ha ingresado el usuario y/o contraseña incorrectamente 3 veces seguidas. Por razones de seguridad, el sistema se bloqueara por 15 minutos. Le sugerimos que revise sus datos antes de ingresarlos para evitar esto en el futuro. Gracias.';
       exit();
   }
}
   
?>
   </td>
   <td><img src="../images/spacer.gif" width="1" height="236" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3"><img name="indexr5_c2r5_c2" src="../images/indexr5_c2r5_c2.jpg" width="501" height="41" border="0" id="indexr5_c2r5_c2" usemap="#m_indexr5_c2r5_c2" alt="" /></td>
   <td><img src="../images/spacer.gif" width="1" height="41" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="118" border="0" alt="" /></td>
  </tr>
</table>
<p>
  <map name="m_indexr5_c2r5_c2" id="m_indexr5_c2r5_c2">
    <area shape="rect" coords="404,21,501,41" href="../galvax.net/systems" target="_blank" alt="Galvax Systems" />
    <area shape="rect" coords="0,0,140,19" href="../lost_pass.php" target="_self" alt="Recuperar Contraseña" />
  </map>
</p>
</body>
</html>
y me da el siguiente error
Código HTML:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
ya revise el codigo muchas veces y aun asi no encuentro el erro, me podrian ayudar?

gracias!
  #2 (permalink)  
Antiguo 14/06/2009, 13:16
Avatar de Synkronice  
Fecha de Ingreso: octubre-2007
Ubicación: Madrid
Mensajes: 831
Antigüedad: 16 años, 6 meses
Puntos: 48
Respuesta: Ayuda con error porfavor!

Debes concatenar la variable $username entre comillas simple ya que se trata de un string.

Código PHP:
$query"SELECT * FROM admin WHERE username='$username'"
Saludos!
  #3 (permalink)  
Antiguo 14/06/2009, 13:20
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

gracias! ya funciono aha
  #4 (permalink)  
Antiguo 14/06/2009, 13:31
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

Ahora tengo otro problemilla, el codigo deberia de agregar la ip a la base de datos, pero no lo hace, no saben porque?


Código PHP:
<?php

require('../include/database_connection.php');
session_start();
$ip=$_SERVER['REMOTE_ADDR'];
$username=$_POST['username'];
$password=$_POST['password'];

$securitycode='@$galvaxsecurity$@';
$encodedpass=md5($security.$password.$security);
$query"SELECT * FROM admin WHERE username='$username'";
$result=mysql_db_query($database,$query,$conn) or die (mysql_error());


//We verify if the username eists.
if(mysql_num_rows($result)==0)
{
    

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Las Comas de Morales S.P.R. de R.S. - Sistema de Administracion</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
td img {display: block;}.Form_text {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: #000;
}
.links {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: #C90;
    text-decoration: underline;
}
a:hover {
    color: #FC0;
}
</style>
<!--Fireworks CS3 Dreamweaver CS3 target.  Created Sat Jun 13 21:38:00 GMT-0500 (CDT) 2009-->
</head>
<body bgcolor="#ffffff">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="website.png" fwpage="Login" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "1302912333" fwnested="0" -->
  <tr>
   <td><img src="../images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="108" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="285" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="108" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="149" height="1" border="0" alt="" /></td>
   <td><img src="../images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td colspan="5">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="48" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="2">&nbsp;</td>
   <td><img name="indexr2_c3r2_c3" src="../images/indexr2_c3r2_c3.jpg" width="285" height="123" border="0" id="indexr2_c3r2_c3" alt="" /></td>
   <td colspan="2">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="123" border="0" alt="" /></td>
  </tr>
  <tr>
   <td rowspan="4">&nbsp;</td>
   <td colspan="3"><img name="indexr3_c2r3_c2" src="../images/indexr3_c2r3_c2.jpg" width="501" height="34" border="0" id="indexr3_c2r3_c2" alt="" /></td>
   <td rowspan="4">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="34" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3" align="center" valign="middle">
   <?php
   $query_tries
="SELECT * FROM tries where ip ='$ip'";
   
$result_tries=mysql_db_query($database,$query_tries,$conn) or die (mysql_error());
   
// If username doesnt exists, we verify if the clients ip is saved on the database, if not we insert it.
   
if(mysql_num_rows($result_tries)==0)
   {
        
$sql 'INSERT INTO tries (ip, tries, time)  
VALUES ("' 
$ip '",1, time());';
mysql_query($sql);
   }
   else
   {
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
$add_try=$tries+1;
    
$query_update_tries="UPDATE tries SET tries='$add_try'  where ip ='$ip'";  
    
mysql_query($query_update_tries);
   }
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
    
//We verify the number o login tries.
    
if($tries<3)
    {
    echo
'El usuario y/o contraseña ingresados no son corrrectos. Haga click <a href="../index.php" target="_self" class="links">aquí</a> para regresar he intentar de nuevo. Usted ha utilizado '.$tries.' de los 3 intentos de ingreso. Por razones de seguridad, cuando haya usado los 3 intentos su cuenta será bloqueada por 15 minutos.';    
    }
   if(
$tries==3)
   {
       echo
' Usted ha ingresado el usuario y/o contraseña incorrectamente 3 veces seguidas. Por razones de seguridad, el sistema se bloqueara por 15 minutos. Le sugerimos que revise sus datos antes de ingresarlos para evitar esto en el futuro. Gracias.';
       exit();
   }
   

}
else
$array=mysql_fetch_array($result);
if(
$array['password']==$encondedpassword)
{
    
$_SESSION["username"]=$username;
    
$_SESSION["admin"]=$array['name'];
}
else
{
    
$query_tries="SELECT * FROM tries where ip ='$ip'";
   
$result_tries=mysql_db_query($database,$query_tries,$conn) or die (mysql_error());
   
// If username doesnt exists, we verify if the clients ip is saved on the database, if not we insert it.
   
if(mysql_num_rows($result_tries)==0)
   {
        
$sql 'INSERT INTO tries (ip, tries, time)  
VALUES ("' 
$ip '",1, time());';
mysql_query($sql);
   }
   else
   {
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
$add_try=$tries+1;
    
$query_update_tries="UPDATE tries SET tries='$add_try'  where ip ='$ip'";   
    
mysql_query($query_update_tries);
   }
    
$array_tries=mysql_fetch_array($result_tries);
    
$tries=$array_tries["tries"];
    
    
//We verify the number o login tries.
    
if($tries<3)
    {
    echo
'El usuario y/o contraseña ingresados no son corrrectos. Haga click <a href="../index.php" target="_self" class="links">aquí</a> para regresar he intentar de nuevo. Usted ha utilizado '.$tries.' de los 3 intentos de ingreso. Por razones de seguridad, cuando haya usado los 3 intentos su cuenta será bloqueada por 15 minutos.';    
    }
   if(
$tries==3)
   {
       echo
' Usted ha ingresado el usuario y/o contraseña incorrectamente 3 veces seguidas. Por razones de seguridad, el sistema se bloqueara por 15 minutos. Le sugerimos que revise sus datos antes de ingresarlos para evitar esto en el futuro. Gracias.';
       exit();
   }
}
   
?>
   </td>
   <td><img src="../images/spacer.gif" width="1" height="236" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3"><img name="indexr5_c2r5_c2" src="../images/indexr5_c2r5_c2.jpg" width="501" height="41" border="0" id="indexr5_c2r5_c2" usemap="#m_indexr5_c2r5_c2" alt="" /></td>
   <td><img src="../images/spacer.gif" width="1" height="41" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3">&nbsp;</td>
   <td><img src="../images/spacer.gif" width="1" height="118" border="0" alt="" /></td>
  </tr>
</table>
<p>
  <map name="m_indexr5_c2r5_c2" id="m_indexr5_c2r5_c2">
    <area shape="rect" coords="404,21,501,41" href="../galvax.net/systems" target="_blank" alt="Galvax Systems" />
    <area shape="rect" coords="0,0,140,19" href="../lost_pass.php" target="_self" alt="Recuperar Contraseña" />
  </map>
</p>
</body>
</html>
  #5 (permalink)  
Antiguo 14/06/2009, 13:37
Avatar de Synkronice  
Fecha de Ingreso: octubre-2007
Ubicación: Madrid
Mensajes: 831
Antigüedad: 16 años, 6 meses
Puntos: 48
Respuesta: Ayuda con error porfavor!

En estos momentos lo mejor es debuggear.

Prueba a realizar un ECHO de la variable $sql para verificar que la SQL de insercción se esta generando correctamente.

Código PHP:
ç
$sql 
'INSERT INTO tries (ip, tries, time) VALUES ("' $ip '",1, time());';
echo 
$sql
A simple vista parece que estás volviendo a tener problemas con las comillas, prueba esto a ver

Código PHP:
$sql 'INSERT INTO tries (ip, tries, time) VALUES (\'' $ip .'\',1, time());'
Saludos!
  #6 (permalink)  
Antiguo 14/06/2009, 13:45
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

probe el echo que me dijiste y me dio esto:

INSERT INTO tries (ip, tries, time) VALUES ("68.203.221.112",1, time());

la ip si la obtiene y todo pero no la inserta :(
que podra ser?
  #7 (permalink)  
Antiguo 14/06/2009, 13:53
Avatar de gioramies  
Fecha de Ingreso: febrero-2008
Ubicación: Colombia
Mensajes: 217
Antigüedad: 16 años, 1 mes
Puntos: 14
Respuesta: Ayuda con error porfavor!

Quizás el problema se encuentra en la base de datos. ¿Qué tipo de datos colocaste en el campo ip de tu base de datos?
  #8 (permalink)  
Antiguo 14/06/2009, 13:54
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

varchar, no me habia fallado antes :/
  #9 (permalink)  
Antiguo 14/06/2009, 14:01
Avatar de Synkronice  
Fecha de Ingreso: octubre-2007
Ubicación: Madrid
Mensajes: 831
Antigüedad: 16 años, 6 meses
Puntos: 48
Respuesta: Ayuda con error porfavor!

Ayudate de la funcion mysql_error() para averiguar si la bbdd está devolviendo alguna excepción.

Mira aquí como se usa (es facil)

http://es2.php.net/manual/es/function.mysql-error.php
  #10 (permalink)  
Antiguo 14/06/2009, 14:02
Avatar de gioramies  
Fecha de Ingreso: febrero-2008
Ubicación: Colombia
Mensajes: 217
Antigüedad: 16 años, 1 mes
Puntos: 14
Respuesta: Ayuda con error porfavor!

¿Ahora qué problema te presenta? ¿Se ingresan los demás datos pero la ip no (¿aparece vacía?), no se ingresa ningún dato, aparece algún error, qué tamaño tiene el varchar?
  #11 (permalink)  
Antiguo 14/06/2009, 14:07
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

ya puse la funcion de la siguiente manera
Código PHP:
mysql_query($sql) or mysql_error($sql); 
y me dio el siguiente error

Código HTML:
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/galvaxn/public_html/granerosgalvan/security/authorize.php on line 84
no tengo ni idea de lo que podra ser, nunca habia tenido este problema :(

alguna idea?
  #12 (permalink)  
Antiguo 14/06/2009, 14:08
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

Cita:
Iniciado por gioramies Ver Mensaje
¿Ahora qué problema te presenta? ¿Se ingresan los demás datos pero la ip no (¿aparece vacía?), no se ingresa ningún dato, aparece algún error, qué tamaño tiene el varchar?
No se ingresa ningun dato :(
  #13 (permalink)  
Antiguo 14/06/2009, 20:33
Avatar de gioramies  
Fecha de Ingreso: febrero-2008
Ubicación: Colombia
Mensajes: 217
Antigüedad: 16 años, 1 mes
Puntos: 14
Respuesta: Ayuda con error porfavor!

Creo que no es:

Código:
if(mysql_num_rows($result_tries)==0) { 
$sql = 'INSERT INTO tries (ip, tries, time) VALUES ("' . $ip . '",1, time());'; mysql_query($sql);
}
sino:

Código:
if(mysql_num_rows($query_tries)==0) { 
$sql = 'INSERT INTO tries (ip, tries, time) VALUES ("' . $ip . '",1, time());'; mysql_query($sql);
}
Creo que utilizas la variable incorrecta, por eso no entra en el if.
  #14 (permalink)  
Antiguo 14/06/2009, 21:14
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

Cita:
Iniciado por gioramies Ver Mensaje
Creo que no es:

Código:
if(mysql_num_rows($result_tries)==0) { 
$sql = 'INSERT INTO tries (ip, tries, time) VALUES ("' . $ip . '",1, time());'; mysql_query($sql);
}
sino:

Código:
if(mysql_num_rows($query_tries)==0) { 
$sql = 'INSERT INTO tries (ip, tries, time) VALUES ("' . $ip . '",1, time());'; mysql_query($sql);
}
Creo que utilizas la variable incorrecta, por eso no entra en el if.
No creo, porque asi lo tengo en otras paginas y me funciona perfectamente :( ya no se que hacer :/
  #15 (permalink)  
Antiguo 14/06/2009, 21:18
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Ayuda con error porfavor!

Cita:
Iniciado por alonsoandres Ver Mensaje
ya puse la funcion de la siguiente manera
Código PHP:
mysql_query($sql) or mysql_error($sql); 
Se supone que se escriba asi

Código PHP:
mysql_query($sql) or die(mysql_error()); 
Si te sale algun error en el query te lo va a decir y no va a continuar

Me dejas saber
  #16 (permalink)  
Antiguo 14/06/2009, 21:35
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

Cita:
Iniciado por abimaelrc Ver Mensaje
Se supone que se escriba asi

Código PHP:
mysql_query($sql) or die(mysql_error()); 
Si te sale algun error en el query te lo va a decir y no va a continuar

Me dejas saber
ahora me dio este error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1
  #17 (permalink)  
Antiguo 14/06/2009, 21:55
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Ayuda con error porfavor!

Verifica bien el query estas ingresando una informacion no correcta y esta ocacionando un problema cerca de donde te esta diciendo el error
  #18 (permalink)  
Antiguo 14/06/2009, 22:28
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

no allo el error :(
  #19 (permalink)  
Antiguo 14/06/2009, 23:42
Avatar de alonsoandres  
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: Ayuda con error porfavor!

solucionado!!! era un problemilla con las comillas en las querys que hacia mmta tomo mas de 12 hora s encontrar el error jaja pero finalmente funciona!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:39.