473,394 Members | 1,800 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,394 software developers and data experts.

Clear parts of a field after / sign

Hello,
I hope somebody can help me with this. I have a collumn in a database which contains titles. The problem is that it contains the dutch title and then the english title devided by a '/' sign. Like this:
"hallo / hello"
I only want it to display the dutch title when i run a query on my website. So i want to delete the part after (and including) the '/' from my database.
Is there a way to do this with some php or something? I am not that good with php, so if someone could give me the exact code it would be awsome.

Thanx
Jul 12 '07 #1
1 1165
mwasif
802 Expert 512MB
This query will display the dutch title only (remove the portion after first occurence of /). This query does not change any thing in database.

Expand|Select|Wrap|Line Numbers
  1. SELECT SUBSTRING_INDEX(title, '/', 1) AS dutch_title FROM table_name
If you want to change the title in database permanently, then run a UPDATE query
Expand|Select|Wrap|Line Numbers
  1. UPDATE table_name SET 
  2. title = SELECT SUBSTRING_INDEX(title, '/', 1)
If you plan to update this in database, take backup of table.
Jul 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: TaiwanNoWhere | last post by:
// case 1 int Option = 0; for(;;) { cin >> Option; switch(Option) { case 1:
8
by: tshad | last post by:
I have a function that formats currency to add commas and $. But I also check to see if the field is empty and if it is I return. The problem is that the field now contains the word...
3
by: Rick | last post by:
I have an interesting problem when I run the following code in Netscape (7.02) vs. IE. This page works great in IE and all my controls bring up the validation summary dialog box if the required...
2
by: Andrea Williams | last post by:
I have a form where the user chooses reporting options and when submit is clicked, I need to present them with dynamically created excel file. In Classic ASP I would just change the viewing...
4
by: Patrick.O.Ige | last post by:
Whats the best way to clear textboxes? Any ideas?
77
by: Ville Vainio | last post by:
I tried to clear a list today (which I do rather rarely, considering that just doing l = works most of the time) and was shocked, SHOCKED to notice that there is no clear() method. Dicts have it,...
3
by: Rick | last post by:
I have a customer order form with a subform that lists parts per customer order that I'm updating. I'm trying to filer the parts list per Manufacture and Model number so that the user doesn't have...
1
by: grannyguest | last post by:
Hi, My name is Linda. I am retrieving a field defined in SQL Server as Number 5(5,3). I need to convert that field to a percentage number but I do not want the % sign. For example if the field...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.