
19/06/2010, 02:10
|
| | Fecha de Ingreso: junio-2010
Mensajes: 6
Antigüedad: 14 años, 10 meses Puntos: 0 | |
Respuesta: ayuda en login ya lo e probado así y me sale el siguiente error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/alumnes/esi-2p-09/09esi98/public_html/laweb/login.php on line 8
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 ' PASS_USU=''' at line 1
de el siguiente codigo:
<?php
$nik=$_POST['nik'];
$pass=$_POST['pass'];
$conexion=mysql_connect("localhost","09esi98","sup er3");
mysql_select_db("09esi98",$conexion);
$sql="SELECT NIK_USU, PASS_USU FROM USUARIOS_CS WHERE NIK_USU='$nik', PASS_USU='$pass'";
$result=mysql_query($sql,$conexion);
while ($fila=mysql_fetch_array($result) or die (mysql_error()))
{
if($fila['NIK_USU']==$nik && $fila['PASS_USU']==$pass )
{
echo "usuario correcto";
}
else
{
echo "usuario incorrecto";
}
}
?> |