I want to display all data from two different tables, but if I use the following code:
$jokelist = mysql_query(
"SELECT ipnumber, realtime, useragent " .
"FROM ipsucker, user_agent WHERE AID=user_agent.ID");
while ($joke = mysql_fetch_array($jokelist)) {
$ip3 = $joke["ipnumber"];
$timmy3 = $joke["realtime"];
$usa3 = $joke["useragent"];
echo "<BR>$ip3, $usa3,$timmy3<BR>";
}
I have to create a new column in every table (AID and ID) and assign increasing numbers (first entry would be AID=1 and ID=1, second AID=2 and ID=2 etc.), and I don't know how to tell mysql to insert a new number (last number+1) every time new entries are added to the database.
Maybe there is another possibility to display all values only once, without adding new columns (AID and ID) to every table at all? or if not, how do I tell mysql to add new values to the ID and AID columns everytime new information is added to both tables?