I'd like to be able to sort an array by one of the 3 values (username, joindate, or last_login) before it gets echod off. using ksort($value[2]); or something that would work. How can I go about doing this? while ($row[67] = mysql_fetch_assoc($result[67])) { $rowRe[] = array(1=>$row[67]['username'], $row[67]['joindate'], $row[67]['last_login']); } foreach ($rowRe as $value) { echo(' <tr align="left" class="accountinfo"> <td align="center">' . $iii++ . '</td> <td>' . $value[1] . '</td> <td align="center">' . substr($value[2], 0, -9) . '</td> <td align="left" colspan="7">' . substr($value[3], 0, -9) . '</td> </tr>'); } PHP:
because i'm pulling information from multiple tables and databases. Join queries can't do that.. well.. as far as I know.
As long as it's all combined in one query, you can sort any way you like, by any combination of criteria.
What's the best way to select 3 databases with one query? I know how to select multiple tables, but not databases.
Using MySQL? Just stick the database name in the beginning: select table_1.field_A, table_2.field_B from database_Q.table_1, database_Z.table_2 etc.
ok.. Yes... congrats.. I feel stupid now.. LOL I see that all the time.. however, it never occurred to me lol. When two tables contain same fields names, lets say table1.field_ID, table2.field_ID, will that cause an conflict?
It's no problem as long as you refer to them unambiguously. For example, if both table1 and table2 have a field called "field_ID", then never write "field_ID" on its own; instead always write "table1.field_ID" or "table2.field_ID".