php-windows Digest 8 Apr 2010 04:34:35 -0000 Issue 3782
Topics (messages 29976 through 29980):
Re: Changing a column to proper case
29976 by: Ferenc Kovacs
29977 by: Niel Archer
29978 by: Bill Mudry
29979 by: Ferenc Kovacs
Re: Windows binaries
29980 by: Todd Oberly
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Wed, Apr 7, 2010 at 7:42 AM, Bill Mudry <billmu...@rogers.com> wrote:
> I have a MySQL file that is filled with information on the different woods
> of the world.
> In one column for the botanical species names, some of the first characters
> in each
> record are not capitalized when they should all be while many are properly
> capitalized.
> I need to correct this. The database is "TAXA". The column is
> "species_name".
>
> I have been using SQL statements through both phpMyAdmin and MySQL-front as
> front ends to the database. I get part way ok but need others help to
> understand why the final
> step does not work as follows:
>
> ..........................................................................................................................
>
> This statement faithfully reports the first character in the
> species_name field:
>
> SELECT UCASE(LEFT(species_name, 1)) from species;
>
> This statement faithfully produces all other characters after the first
> one in the specie_name field:
>
> SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>
> When I run both together, there is no error:
>
> SELECT UCASE(LEFT(species_name, 1)) FROM species;
> SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>
> When I finally try to concatenate the first character back together
> with the rest of the species name, it does not work:
>
> SELECT CONCAT(
> UCASE(LEFT(species_name, 1)) FROM species,
> RIGHT(species_name, LENGTH(species_name)) FROM species
> );
>
> Instead, I get an error near FROM species, RIGHT(species_name,
> LENGTH(species_name)) FROM species
>
> I know I must be close but cannot find out why this is not just working.
>
> Also, when it finally reports the full species names correctly, does it
> matter if I add in a SET statement to finally
> replace the old entries or should I use an UPDATE command instead of
> SELECT? Does it matter?
>
> I look forward to your suggestions.
>
> Bill Mudry
>
>
> You don't have to duplicate the FROM part
SELECT
CONCAT(
UCASE(LEFT(species_name, 1)),
RIGHT(species_name, LENGTH(species_name))
)
FROM species;
should work.
Tyrael
--- End Message ---
--- Begin Message ---
> I have a MySQL file that is filled with information on the different
> woods of the world.
> In one column for the botanical species names, some of the first
> characters in each
> record are not capitalized when they should all be while many are
> properly capitalized.
> I need to correct this. The database is "TAXA". The column is "species_name".
>
> I have been using SQL statements through both phpMyAdmin and
> MySQL-front as front ends to the database. I get part way ok but need
> others help to understand why the final
> step does not work as follows:
> ..........................................................................................................................
>
> This statement faithfully reports the first character in the
> species_name field:
>
> SELECT UCASE(LEFT(species_name, 1)) from species;
>
> This statement faithfully produces all other characters after the first
> one in the specie_name field:
>
> SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>
> When I run both together, there is no error:
>
> SELECT UCASE(LEFT(species_name, 1)) FROM species;
> SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>
> When I finally try to concatenate the first character back together
> with the rest of the species name, it does not work:
>
> SELECT CONCAT(
> UCASE(LEFT(species_name, 1)) FROM species,
> RIGHT(species_name, LENGTH(species_name)) FROM species
> );
you have "FROM species" duplicated. A SELECT can only have one FROM
clause (but several tables in it). Try this.
SELECT CONCAT(
UCASE(LEFT(species_name, 1)), RIGHT(species_name,
LENGTH(species_name))
FROM species
);
> Instead, I get an error near FROM species, RIGHT(species_name,
> LENGTH(species_name)) FROM species
>
> I know I must be close but cannot find out why this is not just working.
>
> Also, when it finally reports the full species names correctly, does
> it matter if I add in a SET statement to finally
> replace the old entries or should I use an UPDATE command instead of
> SELECT? Does it matter?
>
> I look forward to your suggestions.
>
> Bill Mudry
>
>
--
Niel Archer
--- End Message ---
--- Begin Message ---
Tyrael also suggested that and it worked! :-) .
That sure beats manually going through 6,500 records!
Now I need a statement (UPDATE or SELECT SET?) to permanently correct
all entries in the
species_name column. I tried both but do not have my syntax quite right.
Bill
At 02:08 AM 07/04/2010, you wrote:
> I have a MySQL file that is filled with information on the different
> woods of the world.
> In one column for the botanical species names, some of the first
> characters in each
> record are not capitalized when they should all be while many are
> properly capitalized.
> I need to correct this. The database is "TAXA". The column is
"species_name".
>
> I have been using SQL statements through both phpMyAdmin and
> MySQL-front as front ends to the database. I get part way ok but need
> others help to understand why the final
> step does not work as follows:
>
..........................................................................................................................
>
> This statement faithfully reports the first character in the
> species_name field:
>
> SELECT UCASE(LEFT(species_name, 1)) from species;
>
> This statement faithfully produces all other characters after the first
> one in the specie_name field:
>
> SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>
> When I run both together, there is no error:
>
> SELECT UCASE(LEFT(species_name, 1)) FROM species;
> SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>
> When I finally try to concatenate the first character back together
> with the rest of the species name, it does not work:
>
> SELECT CONCAT(
> UCASE(LEFT(species_name, 1)) FROM species,
> RIGHT(species_name, LENGTH(species_name)) FROM species
> );
you have "FROM species" duplicated. A SELECT can only have one FROM
clause (but several tables in it). Try this.
SELECT CONCAT(
UCASE(LEFT(species_name, 1)), RIGHT(species_name,
LENGTH(species_name))
FROM species
);
> Instead, I get an error near FROM species, RIGHT(species_name,
> LENGTH(species_name)) FROM species
>
> I know I must be close but cannot find out why this is not just working.
>
> Also, when it finally reports the full species names correctly, does
> it matter if I add in a SET statement to finally
> replace the old entries or should I use an UPDATE command instead of
> SELECT? Does it matter?
>
> I look forward to your suggestions.
>
> Bill Mudry
>
>
--
Niel Archer
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
UPDATE species SET species_name =
CONCAT(
UCASE(LEFT(species_name, 1)),
RIGHT(species_name, LENGTH(species_name)-1)
);
Should work, but didn't tested.
Tyrael
On Wed, Apr 7, 2010 at 8:12 AM, Bill Mudry <billmu...@rogers.com> wrote:
> Tyrael also suggested that and it worked! :-) .
> That sure beats manually going through 6,500 records!
>
> Now I need a statement (UPDATE or SELECT SET?) to permanently correct all
> entries in the
> species_name column. I tried both but do not have my syntax quite right.
>
> Bill
>
>
> At 02:08 AM 07/04/2010, you wrote:
>
>> > I have a MySQL file that is filled with information on the different
>> > woods of the world.
>> > In one column for the botanical species names, some of the first
>> > characters in each
>> > record are not capitalized when they should all be while many are
>> > properly capitalized.
>> > I need to correct this. The database is "TAXA". The column is
>> "species_name".
>> >
>> > I have been using SQL statements through both phpMyAdmin and
>> > MySQL-front as front ends to the database. I get part way ok but need
>> > others help to understand why the final
>> > step does not work as follows:
>> >
>> ..........................................................................................................................
>> >
>> > This statement faithfully reports the first character in the
>> > species_name field:
>> >
>> > SELECT UCASE(LEFT(species_name, 1)) from species;
>> >
>> > This statement faithfully produces all other characters after the first
>> > one in the specie_name field:
>> >
>> > SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>> >
>> > When I run both together, there is no error:
>> >
>> > SELECT UCASE(LEFT(species_name, 1)) FROM species;
>> > SELECT RIGHT(species_name, LENGTH(species_name)-1) FROM species;
>> >
>> > When I finally try to concatenate the first character back together
>> > with the rest of the species name, it does not work:
>> >
>> > SELECT CONCAT(
>> > UCASE(LEFT(species_name, 1)) FROM species,
>> > RIGHT(species_name, LENGTH(species_name)) FROM species
>> > );
>>
>> you have "FROM species" duplicated. A SELECT can only have one FROM
>> clause (but several tables in it). Try this.
>>
>> SELECT CONCAT(
>> UCASE(LEFT(species_name, 1)), RIGHT(species_name,
>> LENGTH(species_name))
>> FROM species
>> );
>>
>>
>> > Instead, I get an error near FROM species, RIGHT(species_name,
>> > LENGTH(species_name)) FROM species
>> >
>> > I know I must be close but cannot find out why this is not just working.
>> >
>> > Also, when it finally reports the full species names correctly, does
>> > it matter if I add in a SET statement to finally
>> > replace the old entries or should I use an UPDATE command instead of
>> > SELECT? Does it matter?
>> >
>> > I look forward to your suggestions.
>> >
>> > Bill Mudry
>> >
>> >
>>
>> --
>> Niel Archer
>>
>>
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
--- End Message ---
--- Begin Message ---
-----Original Message-----
>From: Pierre Joye <pierre....@gmail.com>
>Sent: Apr 5, 2010 6:08 AM
>To: Todd Oberly <taobe...@mindspring.com>
>Cc: php-wind...@lists.php.net
>Subject: Re: [PHP-WIN] Windows binaries
>
>On Mon, Apr 5, 2010 at 6:27 AM, Todd Oberly <taobe...@mindspring.com> wrote:
>
>> I've heard of FastCGI, but never used it before. If I want to get the
>> application running ASAP without FastCGI (please don't argue), what would be
>> the effect of using the thread-safe VC6 build of 5.2.13? Just a decrease in
>> performance?
>
>PHP TS is slightly slower than PHP NTS but not in a significant
>manner. However the stability of the ISAPI may affect your sites much
>more than the TS vs NTS delta. Many crashes have worst side effects
>than slowdowns.
A short follow-up. I had the PHP application package running through ISAPI for
a short time, but then noticed errors like
Faulting application w3wp.exe, version 6.0.3790.3959, faulting module unknown,
version 0.0.0.0, fault address 0x01b45c80.
in the Event Viewer. Soooo after some investigation, FastCGI is now the
solution. :) But I then noticed something strange, but am not sure if it's
related. I then started seeing a warning in my browser when running a certain
aspect of the script. I'd done this a number of times before, but saw no
errors. Could there be something about the ISAPI interface that was blocking
error output?
Thanks,
Todd
--- End Message ---