Jump to content

Multiple records


gerkintrigg

Recommended Posts

I seem to have a problem when outputting data from my site search.

 

It used to work fine but it seems that I have a huge number of records in my database with the same information or (FAR more likely), I'm calling that data multiple times.

 

Here's my code:

 

$search_explode=$search;
$my_search_explode=explode(' in ',$search);
$biz_type=trim($my_search_explode[0],'s');
$town_to_search=$my_search_explode[1];
	$q="SELECT `page_title`,`profile_name`,`page_id`,`content`,`active`,`small_logo`,`pages`.`member_id` as `pmid` 
 FROM `types_of_pages`, `pages`,`profiles` WHERE `pages`.`profile`=`profiles`.`id` AND ((`page_title` LIKE 
 '%".$search."%')OR(`content` LIKE '%".$search."%') OR (`profiles`.`type_of_biz`=`types_of_pages`.`id` &&  
 `types_of_pages`.`type_of_page`LIKE '$biz_type%' && `profiles`.`town` LIKE '$town_to_search')) AND `active`='y' 
 ORDER BY `page_title`,`content`  Group By ASC LIMIT $offset, $rowsperpage";

 

I'm not really sure where the problem is, so wondered if you guys might be able to help.

 

If you want an example of what it does, visit http://www.truro.com and search for "tennis".

 

Thanks,

Neil

Link to comment
https://forums.phpfreaks.com/topic/265746-multiple-records/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.