View Single Post
Old 06-18-2022, 12:49 AM  
natkejs
Confirmed User
 
Industry Role:
Join Date: Jan 2003
Location: Nomad Land
Posts: 1,629
Quote:
Originally Posted by Publisher Bucks View Post
It gets opened at the top of the page:



Then presently, I'm using an echo to call a specific field of data from the table:
Ok so the sponsor column has already been extracted into $sponsor.
Instead of printing $name lets print $string which we will add strong tags to in case $sponsor is set to "Yes".

PHP Code:
$string = ( $sponsor == 'Yes' ) ? "<strong>$name</strong>" $name;
echo 
$string
You could also use a full if / else statement together with $name only but I think it's less fancy for some reason.
Though if you want to do more logic in case $sponsor is set to Yes than this would be a better way to go.

PHP Code:
if ( $sponsor == 'Yes' ) {
 echo 
"<strong>$name</strong>";
}
else {
 echo 
$name;

__________________
natkejs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote