Greetings programmers, Im Victor or Burguez, from Monterrey Mexico, I am working on my college (www.mty.itesm.mx) on a page and i have trouble trying to make a query work with my database. I have PHP 4.3.3, working on a Dell precision340 (neat machine 😃 ) Windows XP stuff.
Here is the code (a HTML page calls this php code):
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<?
$u = $POST["usuario"];
$p = $POST["password"];
$con = odbc_connect("CEDEE", "", "");
$consulta = "SELECT usr, pwd FROM tbl_alumno WHERE usr='$u' AND pwd='$p'";
$aux = odbc_exec($con, $consulta) or die("<p>".odbc_errormsg());
if(odbc_num_rows($aux))
{
$row = odbc_fetch_row($aux);
}
else
{
echo die("Error...");
}
odbc_close($con);
?>
</BODY>
</HTML>[/i]
And I get this error:
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Few parameters. Expected 2., SQL state 07001 in SQLExecDirect in c:\inetpub\wwwroot\burguez.php on line 13
[Microsoft][ODBC Microsoft Access Driver] Few parameters. Expected 2.
What is the mistake??
Thanks D00ds!