Hello
I'm creating a guestbook where entries from public and private mysql tables are all collected simultaneously and displayed on a page ordered by date.
there is a field called TYPE and DATE in both tables. I've got something like:
$guestbook_query = "guestbook";
$result = mysql_query("SELECT * FROM $newpages_db, $forum_db WHERE $newpages_db.type = '$guestbook_query' OR $forum_db.type = '$guestbook_query' ORDER BY $newpages_db.date,$forum_db.date ",$db);
but each entry returned is duplicated by the number of entries meeting the criteria ie.
entry1 = the guest book title1
entry2 = the guest book title2
entry3 = the guest book title3
it prints:
entry1 = the guest book title1
entry1 = the guest book title1
entry1 = the guest book title1
entry2 = the guest book title2
entry2 = the guest book title2
entry2 = the guest book title2
entry3 = the guest book title3
entry3 = the guest book title3
entry3 = the guest book title3
i've tried DISTICT but that obviously only returns the distinct date or type I request ie if two entries have been posted on the same day it will display the one distinct date the two were created on
Can anyone help?
Cheers John