RE: [PHP] possible to use eregi instead of LIKE
| From: | Jay Blanchard | Date: | Mon, 02 May 2005 19:06:44 +0000 |
| Subject: | RE: [PHP] possible to use eregi instead of LIKE | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-214340@lists.php.net to get a copy of this message | ||
[snip]
Is it possible to use eregi instead of LIKE to filter mysql queries?
If so can someone do a quick example?
[/snip]
$sql = "SELECT foo, bar FROM table ";
$result = mysql_query($sql, $connection);
while($row = mysql_fetch_array($result)){
if(eregi('glorp', $row['foo']){
echo $row['bar'] . "\n";
}
}
Why you'd want to do it this way beats me, the overhead is a lot bigger
than doing it in the query.