so there are 2 tables course participant and past participant - both have same fields.
i want to write a query that selects both from course participant and past participant if search option "find all" is called.
i out everypossible combination but it just doesnt get right - pls help
rukshilag
0
Junior Poster
Recommended Answers
Jump to PostShow your query. You can use UNION to combine the results of two tables.
Jump to PostIf your tables are indeed exactly the same, you can do something like this:
select * from course_participant where name LIKE '%$q%' UNION select * from past_participant where name LIKE '%$q%'
BTW, a lot of your queries are missing FROM...
All 7 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
rukshilag
0
Junior Poster
rukshilag
0
Junior Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
rukshilag
0
Junior Poster
drjohn
56
Posting Pro in Training
rukshilag
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.