Okay, I'm a little confused - this code works perfectly fine in mysql; however, in php it keeps repeating the first person for about 15 rows. Can someone point me to what I'm missing here.
$queryUsers = "SELECT user_id, zipcode, gender, housing_status, active, username FROM users WHERE user_id != '" . $_SESSION['user_id'] . "'
AND active = 1";
$dataUsers = mysqli_query($dbc, $queryUsers);
$rowUsers = mysqli_fetch_array($dataUsers);
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
while ($row = mysqli_fetch_array($dataUsers)) {
echo '
<tr><td class="subtitle" height="30px" colspan="3" align="left" valign="middle">' . $rowUsers['username'] . '</td></tr>
<tr><td width="21%" rowspan="8" align="center" valign="middle"><img alt="profile picture" name="profilepic" width="100" height="100" id="profile picture" /></td></tr>
<tr class="oddrow"><td width="21%" align="left" valign="middle">Age:</td><td width="58%">' . $rowUsers['user_id'] . '</td></tr>
<tr class="evenrow"><td align="left" valign="middle">Gender:</td><td>' . $rowUsers['gender'] . '</td></tr>
<tr><td align="left" valign="middle">Location:</td><td> </td></tr>
<tr class="evenrow"><td align="left" valign="middle">Looking for:</td><td>' . $rowUsers['housing_status'] . '</td></tr>
<tr><td align="left" valign="middle">Has children:</td><td> </td></tr>
<tr class="evenrow"><td align="left" valign="middle">Type of pets:</td><td> </td></tr>
<tr class="oddrow"><td align="left" valign="middle">Inside Smoker:</td><td> </td></tr>
<tr class="subtitle"><td> </td><td> </td><td> </td></tr>';
}
echo '</table>';
also if i change mysqli_fetch_array to mysqli_num_rows, I get a million empty rows.