The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need help cleaning up MYSQL data (Has a line break in cell)
I have a strange problem that took me a long time to even figure out what the problem was... I have created a database where two of my fields are the STATE and COUNTRY and I need to be able to use these in conditionals and MYSQL operations in the future...
My problem is that the form that my forum members were using to enter the data (I have over 5000 records in this database) put a line break at the end of each entry..... So, what this means is that if I have three Arizona entries and I print them to the screen I see this (assuming the 1st and 3rd have the extra line break: Arizona Arizona Arizone I found the echo nl2br($row[state]); will show me this: Arizona<br /> Arizona Arizona<br /> Can anyone help me write an update script that will allow me to get rid of these darned /n (or <br /> if I use the nl3br)? Thanks! |
#2
|
||||
|
||||
[sql]UPDATE table
SET state = trim(state), country = trim(country);[/sql] |
#3
|
|||
|
|||
Thanks but it didn't seem to do the trick...
Here is what I tried to use: Code:
UPDATE ts4msresorts SET area = trim(area), country = trim(country); Thanks for the help as you can seemy problem here because as far as the database is concerened I have more then one of a few states and countries and I even used a drop-down select box to try to prevent this before hand... http://www.timeshareforums.com/drop-down-lists.php I am running MySQL 4.1.19 and phpMyAdmin 2.6.4-pl2 Thanks for the advise... I figured out that the following code will do it (The Like %Name% gets it done)... Code:
UPDATE ts4msresorts SET area = 'Alabama' WHERE area LIKE '%Alabama%' Thanks Again! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|