|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
search MySQL Database
Anyone know how to do a search of a MySQL database using SELECT * FROM table_name WHERE MATCH(field_name) AGAINST(search_querry)?
Some sample code would be appriciated. Thanks Artoo Smith artoo_s@hotmail.com |
|
#2
|
|||
|
|||
|
RE: search MySQL Database
is it single search criteria or multiple?
|
|
#3
|
|||
|
|||
|
RE: search MySQL Database
trying to set up for both.
Artoo Smith artoo_s@hotmail.com |
|
#4
|
|||
|
|||
|
RE: search MySQL Database
well the basic single search query would be as follows
select * from my_table where my_field like '%my_search_term%' that would select any records in my_field that either matched or contained my_search_term. As for as multiple keyword searches, just use the OR operator like so select * from my_table where my_field like '%my_search_term%' or my_field like '%my_search_term2%' this will find any records that contain either my_search_term or my_search_term2 Of course this is a basic explaination, so for a more indepth look at searching, check out Matts tutorial at: http://codewalkers.com/tutorials/46/1.html |
|
#5
|
|||
|
|||
|
RE: search MySQL Database
Thanks for the info!! Will take a look at that tutorial as well. Is it possible to search two fields of a database using this method?
Thanks again Artoo Smith artoo_s@hotmail.com |
|
#6
|
|||
|
|||
|
RE: search MySQL Database
yes it is, use the AND operator like so...
select * from my_table where my_field like '%my_search_term%' AND my_field2 like '%my_search_term2%' or for multiple searches select * from my_table where (my_field like '%my_search_term%' or my_field like '%my_search_term2%') and (my_field2 like '%my_search_term3%') |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > search MySQL Database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|