I have a adobe AIR application and I wanted to add a login script to it. So this is what I came up with and I can’t figure out why it wouldn’t return anything. Help would be much appreciated.
<?php
$dbhost = '127.0.0.1';
$dbuser = 'root';
$dbpass = '1111';
$dbname = 'flex';
$conn = sprintf("mysql_pconnect('%s', '%s', '%s')", $dbhost, $dbuser, $dbpass);
if (!$conn)
{
exit("Unable to connect to DB: " . mysql_error());
}
if (!sprintf("mysql_select_db('%s')", $dbname))
{
exit("Unable to select mydbname: " . mysql_error());
}
$users = cw_sql_query('SELECT * FROM volunteer_users');
while(list($pos, $user)=each($users))
{
if($_REQUEST["username"]=$user["username"])
{
if($_REQUEST["password"]=$user["password"])
{
echo("1");
}
else
{
echo("0");
}
}
else
{
echo("0")
}
}
function cw_sql_query($info)
{
global $conn;
$query = mysql_query($info);
dump($query);
$results = array();
while ($result = mysql_fetch_assoc($query))
{
array_push($results, $result);
}
mysql_free_result($query);
Return($results);
}
?>