Hello, all. I'm having a problem with a php/mysql app which is
probably in the SQL, so please don't get angry at me. Basically, I
have a CASE statement that works on my localhost, but doesn't seem to
get recognised on the production server (i'm running php/mysql 5.x on
my localhost, 4.x of both
Good people of php-db, I think I have this solved. For those keeping
score, repeating the CASE condition in the ORDER BY seems to work,
i.e.,
SELECT DISTINCT e.exhibition_id, e.title, e.begin_date,
CASE 'heading'
WHEN UNIX_TIMESTAMP( ) >= e.begin_date
THEN 'Coming Up'
ELSE 'Now Showing'
END 'hea
See this query? I need a separate query that will return ONLY the total
record count that it would come up with. I've tried replacing the select
part with COUNT() but I still get a series of records in my return result.
I just need ONE return value -- the total COUNT of rows returned by this
qu
sneakyimp wrote:
See this query? I need a separate query that will return ONLY the total
record count that it would come up with. I've tried replacing the select
part with COUNT() but I still get a series of records in my return result.
I just need ONE return value -- the total COUNT of rows r
Andrew Darby wrote:
Good people of php-db, I think I have this solved. For those keeping
score, repeating the CASE condition in the ORDER BY seems to work,
i.e.,
SELECT DISTINCT e.exhibition_id, e.title, e.begin_date,
CASE 'heading'
WHEN UNIX_TIMESTAMP( ) >= e.begin_date
THEN 'Coming Up'
ELSE '
chris smith-9 wrote:
>
> Doing this is actually rather easy.
>
> Replace this:
>
> SELECT e.id, e.title, e.subheading, eta.start_timestamp,
> eta.end_timestamp, e.zip, e.bold, e.outline, e.color, e.subheading,
> COUNT(esa.id) AS subcat_count
>
> With:
>
> SELECT COUNT(e.id) AS count
>
>
sneakyimp wrote:
chris smith-9 wrote:
Doing this is actually rather easy.
Replace this:
SELECT e.id, e.title, e.subheading, eta.start_timestamp,
eta.end_timestamp, e.zip, e.bold, e.outline, e.color, e.subheading,
COUNT(esa.id) AS subcat_count
With:
SELECT COUNT(e.id) AS count
Or am I
chris smith-9 wrote:
>
> Ah - that would be the group by doing that.
>
> Removing those:
>
> GROUP BY eta.id ORDER BY subcat_count DESC, eta.id
>
> Does that get you what you want?
>
> If it gives you one result - make sure it's right. Change a few id's,
> make sure they match up to what y
sneakyimp wrote:
chris smith-9 wrote:
Ah - that would be the group by doing that.
Removing those:
GROUP BY eta.id ORDER BY subcat_count DESC, eta.id
Does that get you what you want?
If it gives you one result - make sure it's right. Change a few id's,
make sure they match up to what your
The original query results (minus most of the fields but including the
COUNT(esa.id) part) would look something like this:
id title subcat_count
60 Another Halloween Party 4
50 Satan's Midnight October Bash 1
61 Halloween IPN Testing party 1
19 test 1
64 I happen more than once today 1
6
Is there a slick and easy way to convert January to 01 ? (and February
to 02, etc) Ron
Ron Piggott (PHP) wrote:
Is there a slick and easy way to convert January to 01 ? (and February
to 02, etc) Ron
You asked this on the general list and got a few responses.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubsc
I have completely missed it and need to try again.
search the archive.
On 10/16/06, Ron Piggott (PHP) <[EMAIL PROTECTED]> wrote:
I have completely missed it and need to try again.
--
GMail Rocks!!!
use an array
$months = array('01'=>'January','02'=>'February'...);
$thisMonths = array_flip($months);
$month = $thisMonths['January'];
echo $month;
though its easier to just create the array the other way and the just
reference it
$months = array(''January''=>'01','February'=>'02...');
$mo
15 matches
Mail list logo