PHP: Help with preformance of a series of queries

heathercairo

New Member
I have a method that loops through all the rows of a table where a certain condition is met, and then checks if one of the columns in the row appears in a text. The method is below:\[code\]public function isRecipeType($ingredients, $type){ $rows = $this->fetchAll($this->select()->where("type = ?", $type)); foreach($rows as $row) { if((strpos($ingredients, $row->name)) !== false) { return true; } }}\[/code\]This takes forever, though. How can I speed this up (without removing rows from my table)?
 
Back
Top