![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Europe
Posts: 3,055
|
MySql query help needed asap.
I have a field in db that is 10 char long and its random characters.
I need to either truncate every one of them to 9 chars or replace last characters with "xx" Is there way to do it with query that will update all rows of data?
__________________
My Network Is Waiting For Your Fuckin' Trade! ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Mar 2007
Posts: 7,771
|
MySQHell.
__________________
![]() ![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
probably just change the field from 10 to 9 characters... but make a backup of the table in case something goes wrong...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
|
mysql will prob error if you try to change the field to 9 chrs... back up before trying this, but it should work (and do it to the whole table)
update table set field = substring(field, 1, 9)
__________________
112.020.756 |
![]() |
![]() ![]() ![]() ![]() ![]() |