Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-28-2004, 07:29 PM   #1
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Rep: Reputation: 30
php search array

I am looking for advice. I am using a search class that searches across all fields of a table and returns an array containing the primary keys that meet the keyword search. You can see it here:

My current plan is to place these primary keys into a string like this:

foreach($results_array as $result){
$search_string= $search_string." AND ".$result;

select from table where primarykey='$search_string'

Can anyone think of a better or more efficient way to work with this class? Or maybe a different search class I might want to use?

Old 04-28-2004, 10:50 PM   #2
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
If you are using mysql you can use fulltext indexing for fast searches.
Old 04-30-2004, 07:20 AM   #3
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Original Poster
Rep: Reputation: 30
Yes that is a great option, I am a little concerned about the comment "Loading data into a table that already has a FULLTEXT index could be significantly slower." from the mysql page. But a great idea I will give it a try.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Trouble to get Array Gerardoj Programming 5 03-28-2005 07:14 AM
search in char array xxfunkxx Programming 2 12-12-2004 11:23 PM
PHP array help? HappyDude Programming 1 10-13-2003 06:48 PM
multidimensional array (php) niehls Programming 2 01-31-2003 05:34 AM
php array gui10 Programming 2 03-26-2002 02:07 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:10 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration