Re: RIGHT Function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---- Original Message ----
> From: "sono-io@xxxxxxxxxxxxx" <sono-io@xxxxxxxxxxxxx>
> To: PHP General List <php-general@xxxxxxxxxxxxx>
> Sent: Thursday, September 24, 2009 12:01:41 PM
> Subject:  RIGHT Function?
> 
> Hi all,
> 
>     I could use some help.  I've scoured both the MySQL and PHP sites that I 
> know of and can't find an answer to this.
> 
>     I have a price field that sometimes contains entries like this:
> 
> 250,(min)
> 5.32

regex? If 250,(min)5.32 is in your row data, how do you sort price ascending/descending?

> 
>     How can I pull just the price ($5.32 in this example) from this field to 
> display on a web page?  Is there a RIGHT function in PHP?  When I search the PHP 
> site, I'm being told there isn't one.
> 
>     Here's the code I've been using:
> 
> > itemid='WR-1240'",$db);
> printf('List: $%s
', number_format(mysql_result($result,0,"priceList"),2));
> printf('Your Price: $%s', number_format(mysql_result($result,0,"unitprice"),2)); 
> ?>
> 
> Thanks,
> Frank
> 
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux