Search from multiple tables ??

Thread Solved

Join Date: May 2008
Posts: 90
Reputation: Suhacini is an unknown quantity at this point 
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

 
0
  #11
May 9th, 2008
  1. $q = "show tables";

shall i write the table name thr?I have 26 tables...All of the at a time shall i write?is this the way i must write?

  1. $q= " show a,b,c....";
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,833
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 344
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Search from multiple tables ??

 
0
  #12
May 9th, 2008
No. The code that I have given will search for all the tables in the database. (make sure you have only those tables in the database which you want to search). And what I mean by print your query is, echo $searchtables;
Tell us what it prints on the screen.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 90
Reputation: Suhacini is an unknown quantity at this point 
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

 
0
  #13
May 9th, 2008
Error Again...but changed a little than before

  1.  
  2. select * from a where col1 like '%%'
  3. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\exphp\medwits\search.php on line 14
  4.  
  5. select * from b where col1 like '%%'
  6. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\exphp\medwits\search.php on line 14
  7. .
  8. .
  9. .
  10.  
  11. select * from z where col1 like '%%'
  12. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\exphp\medwits\search.php on line 14
Last edited by Suhacini; May 9th, 2008 at 6:41 am.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 90
Reputation: Suhacini is an unknown quantity at this point 
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

 
0
  #14
May 9th, 2008
I have changed the col name...
the i got the result like this

  1. select * from a where MedName like '%searchresult%'select * from b where MedName like '%searchresult%'select * from c where MedName like '%searchresult%'select * from d where MedName like '%searchresult%'select * from e where MedName like '%searchresult%'select * from f where MedName like '%searchresult%'select * from g where MedName like '%searchresult%'select * from h where MedName like '%searchresult%'select * from i where MedName like '%searchresult%'select * from j where MedName like '%searchresult%'select * from k where MedName like '%searchresult%'select * from l where MedName like '%searchresult%'select * from m where MedName like '%searchresult%'select * from n where MedName like '%searchresult%'select * from o where MedName like '%searchresult%'select * from p where MedName like '%searchresult%'select * from q where MedName like '%searchresult%'select * from r where MedName like '%searchresult%'select * from s where MedName like '%searchresult%'select * from t where MedName like '%searchresult%'select * from u where MedName like '%searchresult%'select * from v where MedName like '%searchresult%'select * from w where MedName like '%searchresult%'select * from x where MedName like '%searchresult%'select * from y where MedName like '%searchresult%'select * from z where MedName like '%searchresult%'
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,833
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 344
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Search from multiple tables ??

 
0
  #15
May 9th, 2008
Originally Posted by Suhacini View Post
  1. $q = "show tables";

I have 26 tables...shall i write all the names at once
  1. $q="show a,b,c...z";
Show tables will get all the 26 tables (If you have 26 tables in the database) . Thats a mysql query.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 90
Reputation: Suhacini is an unknown quantity at this point 
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

 
0
  #16
May 9th, 2008
Hey got this...proceeding furthur...will get back to u again with new doubt...Thank You.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,833
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 344
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Search from multiple tables ??

 
0
  #17
May 9th, 2008
Y/w. I ll be here.. ( I hope!)
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 90
Reputation: Suhacini is an unknown quantity at this point 
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

 
0
  #18
May 9th, 2008
wht do u mean by Y/W ??

By da way can we store long text directly in db..not using any insert queries...
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,833
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 344
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Search from multiple tables ??

 
0
  #19
May 9th, 2008
You are welcome.

No. You can't store a value in the table without using an insert query.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 90
Reputation: Suhacini is an unknown quantity at this point 
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

 
0
  #20
May 9th, 2008
cant we enter thm frm back end?

Using insert query can we insert long text?
For example i have a value in db..and i want to describe tht...can i do tht?
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 5910 | Replies: 34
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC