Jump to content

Searching All Of The Tables In A Dstabase


mdmartiny

Recommended Posts

I have a database that has many tables in it. I would like to do a search of all of the databases. I am unsure on how I would do this.

 

Anyone know a way or point me in the right direction. I am looking to search the tables by date and post the top 10 results.

I don't really want to search all of the tables. There are going to be some like users, categories and sub categories. The ones that I want to search are going to be the ones that users post their items they are selling in. Which will be a lot I am not sure how many different sub categories that I am going to have I am still working on them.

Or actually would it be better to have all ads in one table.

 

So I would have these as tables

-users

-category

-sub category

-ads

 

Then I could use the Ids from category and sub category as foreign keys in the ads table. That way I only have to search one table instead of like 50 or however many I end up with.

 

I think I originally was going to go with this but thought it would be easier to understand if I had a table for every sub category.

The more I think about it. It would be kind of hardtop do one table.

 

Different ads are going to require different information.

 

A ad for a car is not going to use the same information as an ad for a chair. Do you have a suggestion for a different way of me to store the information used in my ads. I am just trying to figure out the best way to do it.

 

I just don't want to make the ads to general.

I'd have one table for ads holding title, user, dates etc. then add details which holds rows of many to one relationship with ads.

 

So the general information that all of the ads will contain be in the ads table and then all of the secondary information specific to the particular ad be placed in the details table.

 

Is that correct?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.