Jump to content

Color Code Search


dennismonsewicz

Recommended Posts

try this if you want SQL to do the work

<?php
include  'db.php';

$sql = "SELECT DISTINCT REPLACE(locname, 'ham', '<span style=\'color: red; font-weight: 600\'>ham</span>') 
        FROM towns
        WHERE locname LIKE '%ham'" ;
$res = mysql_query($sql) or die (mysql_error()."<p>$sql</p>");
while ($r = mysql_fetch_row($res))
{
    echo $r[0], '<br>';
}

?>

Link to comment
https://forums.phpfreaks.com/topic/97857-color-code-search/#findComment-500731
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.