I'm using PHP to pull some data my sql like so:
I have two questions, firstly, shouldn't the following work:
and also, what I want to do is echo out the following [0][username], [1][username2] etc etc etc. So what I want to do is use while($users = mysql_fetch_array($get_users)) but also have a for loop which iterates $i by one each time. how can I go about doing this?
sorry if this sounds confusing
Code:
$get_users = ("SELECT * FROM employees");
while($users = mysql_fetch_array($get_users))
{
echo $users['usernmae'];
--- OR ---
echo $users[0]
}
Code:
$get_users = mysql_query("SELECT * FROM employees");
$users = mysql_fetch_arrau($get_users);
for($i=0; $i < count($users); $i++)
{
echo $users[$i][0]
}
sorry if this sounds confusing