473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

strtolower wont do his job

Hi you guys,

in the following insert the strtolower wont put the chars in lowercase.
Any ideas what i'm doing wrong?

the code:

$qryInsRel = "INSERT INTO \"tblrelations\" (rid, vcfirstname,
vclastname, vccompany, vcfunction, nlangid, ngenderid, nuserid,
ntitleid, dtbirthdate, vcbankaccount, vcvatnr, vctraderegisternr)
VALUES(" . $relNextVal .", '" . $_POST["txtFirstName"] . "', '" .

strtolower($_POST["txtLastName"])

.. "', '" . $_POST["txtCompany"] . "', '" . $_POST["txtFunction"] . "',
'" . $_POST["txtLanguage"] . "', '" . $_POST["txtGender"] . "', '" .
$_COOKIE["cUserID"] . "', '" . $_POST["txtTitle"] . "', '" . $bday .
"', '" . $_POST["txtBankaccount"] . "', '" . $_POST["txtVATNr"] . "',
'" . $_POST["txtTradeRegNr"] . "')";

(btw i moved a bit from the layout of the code but the rest is exactly
what i have)
thx in advance,

kristof
Jul 17 '05 #1
13 2485
On Tue, 23 Dec 2003 21:15:21 +0100, Kristof Goossens <ne********@z-web.be>
wrote:
in the following insert the strtolower wont put the chars in lowercase.
Any ideas what i'm doing wrong?

the code:

$qryInsRel = "INSERT INTO \"tblrelations\" (rid, vcfirstname,
vclastname, vccompany, vcfunction, nlangid, ngenderid, nuserid,
ntitleid, dtbirthdate, vcbankaccount, vcvatnr, vctraderegisternr)
VALUES(" . $relNextVal .", '" . $_POST["txtFirstName"] . "', '" .

strtolower($_POST["txtLastName"])

. "', '" . $_POST["txtCompany"] . "', '" . $_POST["txtFunction"] . "',
'" . $_POST["txtLanguage"] . "', '" . $_POST["txtGender"] . "', '" .
$_COOKIE["cUserID"] . "', '" . $_POST["txtTitle"] . "', '" . $bday .
"', '" . $_POST["txtBankaccount"] . "', '" . $_POST["txtVATNr"] . "',
'" . $_POST["txtTradeRegNr"] . "')";

(btw i moved a bit from the layout of the code but the rest is exactly
what i have)


What evidence do you have that it is not converting to lower case?

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2

"Kristof Goossens" <ne********@z-web.be> schreef in bericht
news:bs**********@reader10.wxs.nl...
Hi you guys,

in the following insert the strtolower wont put the chars in lowercase.
Any ideas what i'm doing wrong?


When using mysql (and many other databases), it doesn't make sence to
lowercase data, because non-binary data is treated case-insensitive by
default.
JW

Jul 17 '05 #3
but from what I've been reading about this can be changed in the db can it
not?

--
Best Regards
Dark Angel

--------------------------------------------------------------------------
http://www.stateofmind.me.uk - My Home Page
http://www.keir.net/k9.html - Free spam filter for windows
http://www.shrine2aeris.co.uk - My shrine to Aeris from FF7
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:3f*********************@news.wanadoo.nl...

"Kristof Goossens" <ne********@z-web.be> schreef in bericht
news:bs**********@reader10.wxs.nl...
Hi you guys,

in the following insert the strtolower wont put the chars in lowercase.
Any ideas what i'm doing wrong?


When using mysql (and many other databases), it doesn't make sence to
lowercase data, because non-binary data is treated case-insensitive by
default.
JW

Jul 17 '05 #4

"Dark Angel" <ni***********@hotmail.com> schreef in bericht
news:ns***************@news-binary.blueyonder.co.uk...
but from what I've been reading about this can be changed in the db can it
not?


True, that's why I said `by default`.
JW

Jul 17 '05 #5
On Tue, 23 Dec 2003 22:57:14 +0100, "Janwillem Borleffs" <jw@jwscripts.com>
wrote:
"Kristof Goossens" <ne********@z-web.be> schreef in bericht
news:bs**********@reader10.wxs.nl...

in the following insert the strtolower wont put the chars in lowercase.
Any ideas what i'm doing wrong?


When using mysql (and many other databases), it doesn't make sence to
lowercase data, because non-binary data is treated case-insensitive by
default.


If you want your data stored in lowercase, that's a different matter from how
the database does comparisons. Besides, no database was mentioned.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #6
still learning u see, so it some times good to ask questions. :) keeps them
brains cells alive :)

--
Best Regards
Dark Angel

--------------------------------------------------------------------------
http://www.stateofmind.me.uk - My Home Page
http://www.keir.net/k9.html - Free spam filter for windows
http://www.shrine2aeris.co.uk - My shrine to Aeris from FF7
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:3f***********************@news.euronet.nl...

"Dark Angel" <ni***********@hotmail.com> schreef in bericht
news:ns***************@news-binary.blueyonder.co.uk...
but from what I've been reading about this can be changed in the db can it not?


True, that's why I said `by default`.
JW

Jul 17 '05 #7

"Andy Hassall" <an**@andyh.co.uk> schreef in bericht
news:pr********************************@4ax.com...

If you want your data stored in lowercase, that's a different matter from how the database does comparisons.
Sure, but it's my guess that the data is stored lowercase for an easy match
in a where/like clause. When I'm wrong in my assumption, the OP will ignore
my post.
Besides, no database was mentioned.


No, but an SQL query was. That's why I started with `When using mysql...`.
When not applicable, the audience will ignore my comment automaitcally.
JW

Jul 17 '05 #8

"Dark Angel" <ni***********@hotmail.com> schreef in bericht
news:02*************@news-binary.blueyonder.co.uk...

still learning u see, so it some times good to ask questions. :) keeps them brains cells alive :)


Your absolutely right :-)

Regards,
JW

Jul 17 '05 #9
Janwillem Borleffs wrote:
"Andy Hassall" <an**@andyh.co.uk> schreef in bericht
news:pr********************************@4ax.com...
If you want your data stored in lowercase, that's a different matter from


how
the database does comparisons.

Sure, but it's my guess that the data is stored lowercase for an easy match
in a where/like clause. When I'm wrong in my assumption, the OP will ignore
my post.

Besides, no database was mentioned.

No, but an SQL query was. That's why I started with `When using mysql...`.
When not applicable, the audience will ignore my comment automaitcally.
JW

Hi thx to all for the reply,

i'm using postgre-sql and i need the data in lowercase so i can order it
by surname. Now he orders the data ascending but first for the Uppercase
names and then for the lowercase names so you get something like this:

Aword
Bword
Zword
aword
bword
zword

and if i insert them in lowercase by default this problem should be fixed...

greetz,

kristof
Jul 17 '05 #10
I noticed that Message-ID: <bs**********@reader08.wxs.nl> from Kristof
Goossens contained the following:
Aword
Bword
Zword
aword
bword
zword

and if i insert them in lowercase by default this problem should be fixed...


But you'll have to correct the case again (ie change the first letter to
uppercase using something like substr()) before you can use it. May as
well do that before you store it.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #11
"Geoff Berrow" <bl******@ckdog.co.uk> schrieb im Newsbeitrag
news:e8********************************@4ax.com...
I noticed that Message-ID: <bs**********@reader08.wxs.nl> from Kristof
Goossens contained the following:
Aword
Bword
Zword
aword
bword
zword

and if i insert them in lowercase by default this problem should be
fixed...
But you'll have to correct the case again (ie change the first letter to
uppercase using something like substr()) before you can use it. May as
well do that before you store it.


To convert the first character to uppercase you can use ucfirst().

Anyway I suggest to store the names unchanged, as some might begin with a
lowercase character (van Damme, ar Rashid...). Just convert the string for
the sort. In MySQL there is a UPPER() function to convert to uppercase:

.... ORDER BY UPPER(name)

(not tested). There might be something similar in Postgre SQL.

HTH
Markus
Jul 17 '05 #12
I noticed that Message-ID: <3f***********************@news.easynet.ch>
from Markus Ernst contained the following:
To convert the first character to uppercase you can use ucfirst().
So many functions, so little memory...
Anyway I suggest to store the names unchanged, as some might begin with a
lowercase character (van Damme, ar Rashid...). Just convert the string for
the sort. In MySQL there is a UPPER() function to convert to uppercase:


Yes you are right.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #13
Geoff Berrow wrote:
I noticed that Message-ID: <3f***********************@news.easynet.ch>
from Markus Ernst contained the following:

To convert the first character to uppercase you can use ucfirst().

So many functions, so little memory...
Anyway I suggest to store the names unchanged, as some might begin with a
lowercase character (van Damme, ar Rashid...). Just convert the string for
the sort. In MySQL there is a UPPER() function to convert to uppercase:

Yes you are right.

thx guys it worked

and a Merry X-mass to ya all :)
Jul 17 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Westwood | last post by:
I have a WebForm button. Depending on calculation I wont to send a popup message to the web page. I am not sure of the approach. From the server side code I don't seem to be able to access the...
5
by: manokumar | last post by:
hiye, i notice that some if not all of my folders in winxp pro. are set as read only and its giving me some problem with development. so as the natural thing, i unchecked the read only option and...
2
by: Lasse Edsvik | last post by:
Hello Im trying to run a simple asp.net page and it wont execute......... i run aspnet_regiis -i and it runs successfully..... but my pages wont execute.... what's wrong?? /Lasse
7
by: dhnriverside | last post by:
Hi guys I've got a web application on a Win2k IIS5 server. I've been coding it using anonymous access, and have just come to test the AD stuff - trouble is - all i get is a 402.1 error ("not...
4
by: dhnriverside | last post by:
HI guys I've just written my first independent namespace for my library (yay me!). However, on trying to add it to my website project, it causes an error when I look at the website. It compiles...
5
by: Mr Newbie | last post by:
Debug.Assert( False, "Why wont I display ??") I am trying to use this in my code but it wont display. The app is running on my local machine and the above code under a button click event. What...
10
by: Jerim79 | last post by:
I need to take the output from a query and convert it to lower case. Here is the relevant code: $query="SELECT FNAME, LNAME FROM (table) WHERE FNAME=('$FName') AND LNAME=('$LName')"; $result =...
4
by: robert.szczepanski | last post by:
Hi everybody; I can't change polish sign to small letter. This is my php script: <?php setlocale(LC_ALL, "pl_PL.UTF-8") ; //this function return "pl_PL.UTF-8"
3
by: =?Utf-8?B?SlA=?= | last post by:
<asp:GridView ID="gridResults" runat="server" AutoGenerateColumns="False" Width="98%" PageSize="25" AllowPaging="True" OnSorting="gridResults_Sorting" OnPageIndexChanging...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.