Hi! o Yall can call me Knight. I'm a bit new to php and my class has moved ahead of me really fast, so now I don't know what I'm doing at all hardly. I'm trying to access a database using odbc functions. This code bellow the code I used to try to confirm a password and username on a login screen using a database made with Microsoft Access. yes, i know access is worthless, but it's all we have to work with, so it's what I'm using. Oracle costs money. ^ ;; Could anyone please tell me why my code won't work? Oh, btw the parameters of a row in my database table are ID, username, password, emailaddress, username is the primary key at this stage, and the table itself is named "users". Any time and help you guys could spare me would be greatly appreciated. Thanks!
--Knight
(ps yes i'm using multiple php docs because I don't understand how to use php self. I wasn't there for the lecture. T . T;; )
<?
$db=odbc_connect("hopperj", "", "");
$query="SELECT * FROM users WHERE username='$username1'";
$result=odbc_exec($db,$query);
if($result=null)
{
echo "username does not exsist.";
}
else
{
$password=odbc_result($result,"password");
if ($password1!=$password)
{
echo "Password was incorrect";
}
else
{
echo "login successful Click the 'go' button to connect<br>";
echo "<form action=loggedin.html method=post><input type=submit value=\"go\"></form>";
}
}
?>