Adding to values in a mySQL table - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 08-25-2004, 11:49 AM   #1 (permalink)
Newb Techie
 
Join Date: Mar 2004
Posts: 36
Send a message via AIM to DKasler Send a message via Yahoo to DKasler
Default Adding to values in a mySQL table

Ok... Im trying to merge my forums withs another guys forums and we can not have duplicate post Ids... so. I need a line of code a that will add to the post id value.

example:

PID
1
2
3
4
5

etc and add say... 2000 to the values.

PID
2001
2002
2003
etc

Thanks in advance.

PS. No the field is not auto_incremented so ALTER TABLE (your table) AUTO_INCREMENT = 2000 wil not work
__________________

DKasler is offline  
Old 08-25-2004, 11:59 AM   #2 (permalink)
Newb Techie
 
Join Date: Mar 2004
Posts: 36
Send a message via AIM to DKasler Send a message via Yahoo to DKasler
Default

Thanks. I found what I needed.

update yourtable set PID=PID+2000
DKasler is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 12:07 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.