View Single Post
Old 09-06-2006, 08:57 AM   #3 (permalink)
jumpmuppet
Registered User
 
Join Date: Sep 2006
Posts: 3
jumpmuppet is on a distinguished road
Money_format function

Thanks for getting back to me....

to give you a better understanding of what i,am trying to atain... this is based on a property search enginge so i can enter into my control.php the property $price..

This $price would be stored in my MYSQL database.. once entered the price would be displayed to the user on the broswe.php or search.php..

PHP Code:
//////////////Find a single listing record///////////////////////////////////
    
function findListing()
        {
        
$id $_GET['id'];
        
$sql mysql_query("SELECT * FROM info WHERE pk = '$id'");
        while (
$row mysql_fetch_assoc($sql))
            {
            global 
$dateentered,$name,$address,$city,$state,$zip,$telephone,$fax,$website,$email,$description,
            
$bedrooms,$bedroomshigh,$sqfeet,$price,$pricehigh,$pricetype,$category,$location,$proptype,$view,
            
$units,$delivery,$developer,$fees,$unitsperfloor,$stories,$image1,$image2,$image3,$image4,$image5,
            
$image6,$image7,$image8,$image9,$image10,$image11,$image12,$featured,$mls,$active,$agent,$features;
            
$dateentered $row['dateentered'];
            
$name $row['name'];
            
$address $row['address'];
            
$city $row['city'];
            
$state $row['state'];
            
$zip $row['zip'];
            
$telephone $row['telephone'];
            
$fax $row['fax'];
            
$website $row['website'];
            
$email $row['email'];
            
$description stripslashes($row['description']);
            
$bedrooms $row['bedrooms'];
            
$bedroomshigh $row['bedroomshigh'];
            
$sqfeet $row['sqfeet'];
            
$price $row['price'];
            
$pricehigh $row['pricehigh'];
            
$pricetype $row['pricetype'];
            
$category $row['category'];
            
$location $row['location'];
            
$proptype $row['proptype'];
            
$view $row['view'];
            
$units $row['units'];
            
$delivery $row['delivery'];
            
$developer $row['developer'];
            
$fees $row['fees'];
            
$unitsperfloor $row['unitsperfloor'];
            
$stories $row['stories'];
            
$image1 $row['image1'];
            
$image2 $row['image2'];
            
$image3 $row['image3'];
            
$image4 $row['image4'];
            
$image5 $row['image5'];
            
$image6 $row['image6'];
            
$image7 $row['image7'];
            
$image8 $row['image8'];
            
$image9 $row['image9'];
            
$image10 $row['image10'];
            
$image11 $row['image11'];
            
$image12 $row['image12'];
            
$featured $row['featured'];
            
$mls $row['mls'];
            
$active $row['active'];
            
$agent  unserialize($row['agent']);
            
$features unserialize($row['features']);
            }
////////////turn it into currency/////////////////////
setlocale(LC_MONETARY'en_US');
$price =  money_format('%(#10n'$price) ;    
$pricehigh =  money_format('%(#10n'$pricehigh) ;    
////////////turn it into currency///////////////////// 
        
}
//////////////////////////////////////////////////////////////////////////////// 
hope this helps?? many thanks!!

Last edited by redhead; 09-06-2006 at 09:02 AM. Reason: Use either [code] tags or [php] tags.
jumpmuppet is offline   Reply With Quote