Hi there, i have a php script that fetches info from a mysql database on my server. now that php script sends the variables back to a flash (swf) and it processes it to see if its correct. Now I got the username patted down good, when i enter into a input field in the flash file it does a query to see if there is that username available. Now i need the to fetch the password for that username to see if the user that inputed theirs is correct or not. I have flash posting two variables, Business_Name, and Password to the php file. heres the script for the password,
include ('Include.inc');
#Connects to the database.
mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");
#The SQL query
$result = mysql_query("SELECT $Business_Name FROM $table WHERE Password = '$Password_Head'");
if ($Password == $result) {
print "Status=Success Login Complete&CheckPass=1";
}
else {
print "Status=Wrong Password";
}
?>
now the variables for the table and the server is in the include file, so i knwo that works, the fields Password_Head and Business name are also filled out in the table in the database. Now flash has the variable $Password that is inputed and sent to this php. Business_Name is also inputted in flash and sent to another php which reads-
<?
##The login script accesses the database and checks to see whether your Login name exists. If it does it will select your information from the database and Print it out back to Flash.
##This first line of Code is to load your database variables - The include File should be ##renamed with your database variables.
include ('Include.inc');
#Connects to the database.
mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");
#The SQL query
$result = mysql_query("SELECT * FROM $table WHERE Business_Name = '$Business_Name'");
#This just gets the number of rows in the Query - It's just a check to see if the Name exists - If not it prints out an error statement.
$numR = mysql_num_rows($result);
#If the number of rows is not equal to one then it prints out an error statement - Name not in Database.
if ($numR == 1) {
print "Status=Please enter Password and press Submit&CheckLog=1";
}
else {
print "Status=Failure - Your name was not found";
}
Now that one works fine, just the password one doesnt, can someone help