OK, I have the following table:-
"fanlistings"
It has the following fields:-
id
name
opendate
url
I then have a table for each of those fanlistings. The table name is basically id_fans where id is the id from the fanlistings table.
id_fans
id
fan_name
fan_email
fan_ip
fan_date
fan_url
So, I do the following:-
$select_fanlistings = mysql_query("SELECT id FROM fanlistings");
while ($fanlistings = mysql_fetch_array($select_fanlistings)) {
}
Now, inside the while loop, I need something that will allow me to select the oldest record out of all of the id_fans tables, and another that will allow me to select the newest record out of the id_fans tables.
I believe this requires a relational database query as opposed to flatdatabase query, however I've no idea how to do that...
So I'd be extremely grateful of anyone's help!
All dates are in the yyyymmddhhmmss timestamp format, however using php's date and then inserted into a VARCHAR field, as opposed to mysql's timestamp feature.