28, May 2012

problem with combining text values - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: problem with combining text values
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: problem with combining text values  (Read 2407 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: May 30, 2006, 11:12:57 am »

Hi,

I trying to use to update a field with to pieces of text:

Code:
UPDATE `plaatsnamen` SET tmp_plaats = SUBSTRING(tmp_plaats, 1, 1) LCASE(SUBSTRING(tmp_plaats FROM 2))

but how to put them together? make it one string?

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: May 30, 2006, 11:19:16 am »

got it:

UPDATE
`plaatsnamen`
SET
tmp_plaats = CONCAT(SUBSTRING(tmp_plaats, 1, 1), LCASE(SUBSTRING(tmp_plaats FROM 2)));

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #2 on: May 30, 2006, 01:16:54 pm »

That was fast.

BTW CONCAT can be used with more than one elements, and it is very good for UPDATE's and INSERTS, but very slow in queries in WHERE statements.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: May 31, 2006, 12:03:53 pm »

maybe this is a good example for the snippet library:

a similar function like:

Code:
<?php
ucfirst
(strtolower("HELLO WORLD"));

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 31, 2006, 04:56:34 pm »

maybe this is a good example for the snippet library:
...

In this case we need a new code type : mysql

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2673
Tags : snippets Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: problem with combining text values
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 10:26:24 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.