July 13th, 2000, 09:05 AM
I have several news tables. Each one is structured the same for the moment, apart from the primary key. For example:
WorldNewsID | Headline | Article
TownNewsID | Headline | Article
I want to be able to select all the articles from both tables together - to put them into one table so to speak, with the NewsID value being taken from the appropiate *NewsID column of each table.
Hope that's clear! Just read over it and it might not be. Hope somebody understands...
July 13th, 2000, 10:39 AM
I've had a similar situation this week. Union is not supported (yet), so the dreaded temporary table came to the rescue. Insert both sets of data into the one temp table and then do your select from there. If your primary keys overlap, then create an extra auto_increment column on the temp table.
July 20th, 2000, 10:56 AM
Thanks for your advice.
However, when I try and carry out a query including CREATE TEMPORARY TABLE - I keep getting errors in my syntax. However, when I remove the TEMPORARY from the statement, it is carried out okay.
Basically, I am looking for somewhere on the web that gives me some advice on creating and using temporary tables with php3... not much to ask I hope (!) but the book I have is next to useless.