Hi Chris, if you have your keywords already in an array all you have to do is to create the statement:
foreach($arrayname AS $value) $where_stmt .= OR $value; $stmt = "SELECT ... WHERE ".$where_stmt "; you might have to include an if stmt in the foreach loop because you are not allowed to start with an OR. But you get the idea? Hope this helps, Andy -- ---------------------------------------------------- http://www.globosapiens.net Global Travellers Network! "Chris Barnes" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 000201c21ace$65e66ba0$[EMAIL PROTECTED]">news:000201c21ace$65e66ba0$[EMAIL PROTECTED]... > Hi people, > Im quite new to the list. > > I am trying to construct a php script that will take a string submitted from > a web site, break it up into keywords and add to an array, then perform a > query to a mysql db for each keyword in the array. It will then send the > result to the browser. > > the script is complete so far as I have added the functions to get the > string from the web site, explode it and add it to an array, but i'm having > trouble putting together a loop that will do a new query for every keyword > in the array. > > is anyone able to help me with an example of a loop which could work for me? > > any help very much apreciated :) > > Chris Barnes > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php