Sorry guys, this is rather simple, but for some reason i'm not thinking right.
I have two tables of user names.
I have this SQL:
$sql_query = "SELECT accounts.username, other_accounts.username FROM accounts, other_accounts";
$username_result = mysql_query($sql_query) or die(mysql_error());
The query it self is working fine, or seems to be so far.
I want all of the usernames to then be printed, preferabbly saying which table it came from as well. But i'm not sure what to use, mysql_num_rows, mysql_fetch_rows, mysql_fetch_array, the while(list) the foreach... argh!!!
Too many choices and none seem to be working the way i want. Right now i'm using this:
while(list($username) = mysql_fetch_row($username_result)) {
echo "$username<br>";
}
But i'm only getting the results from the first table, and they are repeating over and over.
Any help or explanation would be greatly appreaciated.
Thanks