Jump to content

[SOLVED] Rename "1" to "Favorite" only in the Output


JREAM

Recommended Posts

I got a column in a MySQL table that grabs out a number value, like: 1, 2, 3, 4.

When I echo it into PHP you get lets say,

 

while (...) {

echo $row;

}

 

and it will come out as a digit.

Is there a way to assign the #'s a value so that,

 

echo $row // if row == 1 change the text to 'favorite';

echo $row // if row == 2 change the text to 'non-favorite';

etc..

 

Is there a good way to go about such a thing?

I dont want it to change the database (because if a global setting changed it needs to stay consistent)

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.