Quote:
Originally Posted by Publisher Bucks
I'm trying to make a data entry from my database bold if it meets the 'yes' criteria in the 'sponsor' field.
I have this so far but, I can't seem to get it working, any help on where/what I am screwing up please?
Is the above even a 'thing'?
I think I'm on the right track but screwing up calling the data and IF statement correcty?
The $conn is opened a little further up the page, and closed below where I want this bold text to appear.
OR as an alternative, should I just put <b></b> around the name in the SQL database and just use htmlspecialchars? Any potential issues with doing that?
|
You are not calling your database at all.
How are you getting the results you are looping through?
You probably have the sponsor column in those results and can just verify against it.
PHP Code:
foreach ( $myResults as $row ) {
$string = 'bla bla bla';
if ( $row['sponsor'] == 'yes' ) $string = "<strong>$string</strong>";
echo $string;
}