473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to search for a data form 5 MySQL table at a time?

I have a MySQL database nammed 'pstu alumni' and five table inside this DB nammed 'agriculture','bba','cse','dvm' and 'fisheries' each table with same field common 'Name' and 'Session'.
Then how can I search for a name from these five table at a time and how to show results?

Please help...

Thanks
Feb 7 '11 #1
7 1872
Oralloy
988 Expert 512MB
Kadir,

Try using a Union query, if you want everything to appear in two columns.

Cheers!
Feb 7 '11 #2
code green
1,726 Expert 1GB
This is usually done with a JOIN statement.
JOIN USING(Name) or Session
Feb 7 '11 #3
Thanks a lot for your response...

Can u plz suggest me the queary in details to do the task specified.

Thanks...
Feb 8 '11 #4
code green
1,726 Expert 1GB
You haven't specified a task, you have asked how to query five tables.
I think you need to make an attempt yourself then come back with any specific problems
Feb 8 '11 #5
I want to search these tabe at a time for a name e.g 'Shoham'.
If match found (e.g. Name='Shoham'), then details information of that person (Shoham) need to print in another page from raw of the table where match found.

Note : I am using php
Feb 8 '11 #6
Oralloy
988 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1. SELECT Name, Session FROM Table1
  2. UNION
  3. SELECT Name, Session FROM Table2
Try looking here for documentation on the SELECT UNION.
Feb 8 '11 #7
Thanks "Oralloy" For Your Valuable Response...

That technique works !

Thanks a lot...
Feb 9 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: steve | last post by:
Hello, I am trying to take all the data from one table and transfer it to another table with exactly the same column names in the same database. I have done this with a small sql script in an...
7
by: greywire | last post by:
So I need to load lots of data into my database. So I discover LOAD DATA INFILE. Great! This little gem loads my CSV in blazing times (compared to parsing the file and doing INSERT for each...
3
by: srinivasuv | last post by:
Hi Friedns, I am working on a j2ee project. How to export MySql table data to a word document......or to a rtf file.......... Urgent.........give me immediate reply...... send to :...
2
by: idorjee | last post by:
hello, i'm trying to write a perl cgi script to insert some values that i get from the my html form. i could manage to get the params from the html and process them (that part is not included in...
1
by: fritzb | last post by:
The mysql server is running. php is running. I can log into mysql locally, modify tables etc. php pages are running on an apache server. but I can not get a simple script in an web page to update...
12
by: cmghosh | last post by:
how to transfer excel worksheet data to mysql table?
2
by: servo | last post by:
I am using the following code. Why it does not insert record in the MySQL Table through php script: <?php $dbhost='localhost'; $dbuser='root'; $dbpass='newpass'; $mysqldb='mysql'; ...
3
by: printline | last post by:
Hello All I need a little help with a phph script to display some specific data from a mysql table. I have a mysql table with 4 columns and 10 rows. I want to display fx. data from row 4, 6, 8...
2
by: nathanwb | last post by:
I have this php code that I can get most of the data to post, but I am having a little bit of trouble.. I am passing the actualy student number to the page i.e. ?&id=1 this is used to pull the...
9
by: PI | last post by:
Hi Guys, I need some assistance with the following scenario please. I know this might be more of a MySQL post than a PHP one, but it is likely some developer has been here before and would be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.