User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,599 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,732 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1025 | Replies: 24 | Solved
Reply
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation: Suhacini is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

  #11  
May 9th, 2008
$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?

$q= " show a,b,c....";
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 239
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Search from multiple tables ??

  #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.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation: Suhacini is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

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

 
select * from a where col1 like '%%'
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

select * from b where col1 like '%%'
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
              .
              .
              .

select * from z where col1 like '%%'
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  
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation: Suhacini is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

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

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  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 239
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Search from multiple tables ??

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

I have 26 tables...shall i write all the names at once
$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.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation: Suhacini is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

  #16  
May 9th, 2008
Hey got this...proceeding furthur...will get back to u again with new doubt...Thank You.
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 239
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Search from multiple tables ??

  #17  
May 9th, 2008
Y/w. I ll be here.. ( I hope!)
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation: Suhacini is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

  #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  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 239
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Search from multiple tables ??

  #19  
May 9th, 2008
You are welcome.

No. You can't store a value in the table without using an insert query.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation: Suhacini is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Suhacini Suhacini is offline Offline
Junior Poster in Training

Re: Search from multiple tables ??

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC