Jump to content

Searching All Of The Tables In A Dstabase


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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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


So I would have these as tables



-sub category



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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.