Forum Moderators: open
$sth = $dbh->prepare("SELECT table_1.*, table_2.*, table_13.*,table_14.*
FROM table_1
JOIN table_2 ON table_1.id = table_2.id
JOIN table_3 ON table_2.id = table_3.id
JOIN table_4 ON table_3.id where table_1.id = '$_[0]'"); - JOIN table_4 ON table_3.id where table_1.id = '$_[0]'doesn't throw an error? I'm guessing another typo and you meant
ON table_3.id = table_4.id
The reason for the different tables is because each has different types of info.Will each user always have info in each of the tables? If not, use a LEFT JOIN. An INNER JOIN will return no data for a user if there isn't data for it in one of the tables.
see just how many tables I can get away with.Make sure you have an index on the id field for each table. Otherwise, your queries will get slower and slower as you add more tables/data.