I can get an array of the user file when I access the DB. What am I missing is how to use that array to verify the input from the user. The array also contains another piece of data that I need to capture and use on a later page?
Here is the code that generates the array and part of a foreach I was trying to get to work. Am I on the right track?
$sql = "SELECT * from users;";
$result = mysql_query($sql, $dbc); //run the query
if ($result)
{
$html .= '<h2>Result Found </h2>'.PHP_EOL;
//Grab arrays from the result
for($i = 0; $i < mysql_num_rows($result); $i++)
{
$array = mysql_fetch_array($result, MYSQL_ASSOC);
print_r($array);
foreach ('username' as $inputUsername){
echo 'password';
}
}
}
else
{
$html .= '<h2>Error: '.mysql_error().' </h2>';
}