Re: Displaying value different from actual value
| From: | Dave Rosenberg | Date: | Wed, 11 Sep 2002 14:15:13 +0000 |
| Subject: | Re: Displaying value different from actual value | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115983@lists.php.net to get a copy of this message | ||
Thanks Jay. How would that work into something like:
printf("<b>Total Budget:</b> $%s<br>\n", mysql_result($result,0,"budget"));
or
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr><tr>\n", $myrow[0], $myrow[0], $myrow[4], $myrow[8], $myrow[9], $myrow[7], $myrow[10]);
Thanks,
Dave
Jay Blanchard wrote:
[snip] I'm not sure this is possible, but here's what I'd like to do: I know that in order for a set of records from MySQL to display in numerical order on a web page, you need to make the column type "Integer," but here's my situation: I'm creating a database of contracts that my organization has. Normally, there is a dollar amount on these contracts, and I'd like to be able to sort by that value (therefore the Integer column type). However, we have some fee-based contracts, and I'd like a way to display the amount as "Fee Based" even though I can't enter this in the database because of the column type. Is there a way in PHP to have it display this although with some kind of if/then statement or something of that sort? Contract A Fee-basedContract B 70000 Contract C 1250 Contract D 50000[/snip] Pseudocode if($contract_amount == "" || $contract_amount == NULL){ print("Fee-based"); } HTH! Peace ... Jay ****************************************************** Texas PHP Developers Conf Spring 2003 * * T Bar M Resort & Conference Center * * New Braunfels, Texas * * Contact jay.blanchard@niicommunications.com * * ** Want to present a paper or workshop? Contact now! * *****************************************************