I think they problem may be elsewhere.
Assume we got a keyword, e.g. from user input. We don't need to convert it to uppercase, but it must be spelled somehow.
Now we perform the DB query, no problems here.
Then we do the replacement, but if the text from the DB contained the keyword once uppercase, once lowercase, once mixed, it would be always replaced with however the user spelled it (or how we converted it, if we did that).
To solve this, I can only think of backreferences in the replacement argument. Maybe the ereg-functions support this too, but I'd recommend the preg-functions anyway.
Try:
preg_replace("/$keyword_list[$i]/i", "<font color=\"#0000FF\">$0</font>", $comments);
This performs a case-insensitive search for the keyword, $0 is a backreference to the current match.
Hope I got you right,
xblue