Re: formatting currency in mysql

2002-05-06 Thread Issvar

SELECT FORMAT(yourvalue,2)

- Original Message - 
From: Graeme B. Davis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 06, 2002 10:16 PM
Subject: formatting currency in mysql


 Does anyone have a quick tip on how to format a float/numeric in the
 following currency format with a query?
 
 $xx,xxx.xx
 
 Thanks!
 
 Graeme
 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: get one name for each row

2002-05-02 Thread Issvar

It might be faster to instead of getting the list of cities and then in
seperate queries get all hotels for each city, to just sort by city and
fetch all, and in your application check if it has found a next city
already.

Example in php:
$res=mysql_query('select hotel,city from hotels order by city');
$lastcity=;
$firstline=;
while (list($hotel,$city)=mysql_fetch_row($res)) {
  if ($city!=$lastcity) {
$lastcity=$city;
echo brb$city/b;
  }
  echo $hotel ;
}

Just an example, change the html output to what you want it.

- Original Message -
From: savaidis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 02, 2002 10:07 AM
Subject: get one name for each row



 I have one table with about 1000 hotels and name or the city they belong.
 I want to run a query to get one row for every city only, to put it in a
 pull down menu in the search form.
 How is that?

 Makis



 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php