Page 1 of 1

Can certain DB Fields be set to UPPERCASE?

Posted: Fri Oct 18, 2013 11:13 am
by simonmlewis
We need to set ALL entries in three MySQL Database fields to be in all UPPERCASE.
Is there a script that can be run to do this?

These are used dynamically for META TAGS, so it's not about how to render it on screen.

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Fri Oct 18, 2013 1:27 pm
by requinix

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Fri Oct 18, 2013 1:30 pm
by simonmlewis
Sorry? Where in there does it say how to convert a field to UPPERCASE within the database itself?

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Fri Oct 18, 2013 2:27 pm
by requinix
I linked a MySQL function. You're supposed to use that in an UPDATE query.

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Fri Oct 18, 2013 6:02 pm
by simonmlewis
Sorry didn't see a function that explained it would do that.

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Fri Oct 18, 2013 11:24 pm
by Christopher
As in: UPDATE foobar SET foo=UPPER('bar') WHERE id='foo'

You can also use the PHP strtoupper() function.

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Mon Oct 21, 2013 4:54 am
by simonmlewis
But you cannot run a script within phpmyadmin (directly on the server) to set those fields to be UPPERCASE ?

Code: Select all

UPDATE products SET metadescription=UPPER('bar')
What is "bar" ??

Re: Can certain DB Fields be set to UPPERCASE?

Posted: Mon Oct 21, 2013 5:34 am
by requinix
The field.

Code: Select all

UPDATE products SET metadescription = UPPER(metadescription)
You need to take a day out of your busy schedule to learn SQL. Not just the syntax but how it works and what it is capable of. Because there is much more to it than simple INSERT and SELECT statements.