HI Folks,
I have been searching through a few (well about 20) PHP/MYSQL site try to figure this out.
So far all the tutorials and articles concering join table is how to retrieve them. But never tell you this scenario.
Let say I have two tables
art_title
{
art_id auto_increment primary key,
title varchar(200),
author varchar(20),
posted int,
catagory varchar(10)
}
art_body
{
art_id primary key NOT NULL,
body text
}
I bet most of you already notice what's the relation between this two.
The reason why I want to split this into two tables is because the body is actually quite big. Some of the article is huge and the search getting very slow if any user want to search through the db. So I reckon by spliting the table into two will speed up the search cos the user can choose just to search the title or the body. Also when display the list of the articles avaiable is faster for MySQL as well.
The problem I am facing is don't know how to join this two tables when I want to insert data into them. And making absolutely certain that the art_id will be the same on two seperate table. cos this is the link between them if they are not the same. You know the answer...
I have been trying to use one table to hold all the data then take them out and put into two tables. But it's just not ideal.
So I read the whole MYSQL manual and I found they only talk about how to pick things out from join table. But the insert part is kinda missing.
Hope anyone out there have the solution. Since I believe this is a very common method to speed up the SQL query.
Thanks for taking a look.
Hope to hear from you soon.
joel426