Jump to content

Recommended Posts

Hello,

 

In a MySQL database called "feather," I have a lot of tables, and each table has a column called "site." 

 

I'm trying to show all tables that contain a record equal to $entry in the column "site."

 

How do I do that?  I have some code below but I doubt it works.

 

Thanks in advance,

 

John

 

$data = mysql_query("SHOW TABLES FROM feather WHERE site CONTAINS '$entry'") 
or die(mysql_error());

 

Link to comment
https://forums.phpfreaks.com/topic/162269-mysql-show-tables/
Share on other sites

Why do you have a lot of tables that you would like to search at one time? That implies that your table design is not normalized and makes searching for same information across the tables directly impossible.

 

What are these tables are being used for?

 

Edit: Never mind, I just noticed your username. You were previously told that creating separate tables for each topic would not work out. You should not be surprised at this point that you cannot directly search through the different tables and find the information you want.

Link to comment
https://forums.phpfreaks.com/topic/162269-mysql-show-tables/#findComment-856456
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.

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