Re: [PHP] Help with a search array.

2002-03-06 Thread Philip J. Newman
TECTED]> Cc: "Hank Marquardt" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, March 07, 2002 10:54 AM Subject: Re: [PHP] Help with a search array. > I think it does what you want .. explode returns an array, so then you > iterate the array and build your

Re: [PHP] Help with a search array.

2002-03-06 Thread Hank Marquardt
[EMAIL PROTECTED]> > To: "Philip J. Newman" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Thursday, March 07, 2002 10:21 AM > Subject: Re: [PHP] Help with a search array. > > > > $words = explode(" ",$keywords); > > > >

Re: [PHP] Help with a search array.

2002-03-06 Thread Philip J. Newman
--- From: "Hank Marquardt" <[EMAIL PROTECTED]> To: "Philip J. Newman" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, March 07, 2002 10:21 AM Subject: Re: [PHP] Help with a search array. > $words = explode(" ",$keywords); > > foreac

Re: [PHP] Help with a search array.

2002-03-06 Thread Hank Marquardt
$words = explode(" ",$keywords); foreach($words as $word) { Create your sql. } .. or $words[0] = 'first word', $words[1]='second word' That will do what you asked, though I suspect you'll be back when you want to add quoted phrases, such that you could have $q = green eggs "and

[PHP] Help with a search array.

2002-03-06 Thread Philip J. Newman
heres my example: I want to break up the search words in a string. eg: $q = green eggs would like that to be $q1 = green $q2 = eggs ... then the mysql process $sql = ""; for ($i = 0; $i < $num; $i++) if (strlen($getme_arr[$i]) > 0) $sql .= " '%".$getme_arr[$i]."%'";