Jump to content

format specific words within a query???


sportsguru

Recommended Posts

I know it is an "if" statement, but I am struggling with a simple issue.

 

I want to format specific words, like a keyword. (ex: <b>Open</p>, if that word is contained in my ".$data['status']." field of the database ".$db_prefix."fieldstatus.

 

$sql = dbquery(
"SELECT * FROM ".$db_prefix."fieldstatus
ORDER BY fieldstatus_id ASC"
);

if (iADMIN) echo "<center><a href='".MODS."fieldstatus_panel/fieldstatus_admin.php'>".$locale['imp135']."</a><br><br></center>";

if (dbrows($sql)) {
$i = 0;
echo "<table width='100%' cellpadding='0' cellspacing='1'>\n";

while ($data = dbarray($sql)) {

	echo "<tr><td valign='top'><font size='1' color='#db3026'><b>".$data['fields']."</b> is </font><font size='1'>".$data['status']."</font></td></tr><tr>
</tr>\n";
}
echo "</table>\n";
} else {
echo "<center><br>\n".$locale['imp141']."<br><br>\n</center>\n";
}

 

Any suggestions would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/262178-format-specific-words-within-a-query/
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.