"Unknown column 'usuarios' in 'order clause'"
este es el codigo:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<?php
$link= mysql_connect ("localhost", "root", "123456");
mysql_select_db ("inv2", $link);
$login_usuarios = "SELECT * FROM usuarios ORDER BY usuarios ASC";
$logeo = mysql_query($login_usuarios, $link) or die(mysql_error());
$row_Login_Usuario = mysql_fetch_assoc($logeo);
$totalRows_Login_Usuario = mysql_num_rows($logeo);
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['usuario'])) {
$loginUsername=$_POST['usuario'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "nivel";
$MM_redirectLoginSuccess = "Administrador/inicio.php";
$MM_redirectLoginSuccess2 = "pasante/inicio.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($login_usuarios, $link);
$LoginRS__query=sprintf("SELECT usuario, clave FROM usuarios WHERE usuario=%s AND clave=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'nivel');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
if($loginStrGroup==1) { header("Location: " . $MM_redirectLoginSuccess ); }
if($loginStrGroup==2) { header("Location: " . $MM_redirectLoginSuccess2 ); }
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<table width="707" height="201" border="1">
<tr>
<th width="134" height="80" scope="col"> </th>
<th width="557" scope="col">Sistema de inventario </th>
</tr>
<tr>
<th scope="col"> </th>
<th scope="col"><form id="form1" name="form1" method="post" action=""<?php echo $loginFormAction; ?>"">
<p> </p>
<table width="200" border="1">
<tr>
<th scope="col">usuario:</th>
<th scope="col"><label>
<input type="text" name="textfield" id="textfield" />
</label></th>
</tr>
<tr>
<td>password:</td>
<td><label>
<input type="text" name="textfield2" id="textfield2" />
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="enviar" id="enviar" value="Enviar" />
<input type="reset" name="borrar" id="borrar" value="Restablecer" />
</label></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
</form></th>
</tr>
</table>
</body>
</html>