I am trying to make a simple array based off what ID a user has for a login. I know the variable is getting passed correctly because I tested it with a print statement. However, I am stuck on why i cannot get my array to work. I have tried printing the $username variable and it's blank. I am not sure what else to do or try? I appreciate any help.
$db = @mysql_select_db($db_name, $connection) or die("Couldn't Select Database."
$sql = "select username, password from $table_name where username = \"$id\"
";
$result = @mysql_query($sql, $connection) or die("Couldn't execute query."
while ($row = mysql_fetch_array($result)) {
$username = $row["username"];
$password = $row['password'];
}
?>
$db = @mysql_select_db($db_name, $connection) or die("Couldn't Select Database."
$sql = "select username, password from $table_name where username = \"$id\"
";
$result = @mysql_query($sql, $connection) or die("Couldn't execute query."
while ($row = mysql_fetch_array($result)) {
$username = $row["username"];
$password = $row['password'];
}
?>