If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > database user post extraction

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-04, 10:47
albertldee albertldee is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
database user post extraction

please can anyone help me i have a ipb forum some how i accidently delete my post i have a old backup from 3 week ago how can i extract the post from the backup
NOTE: the only post that was deleted was post made by me none of the other member post was deleted
i did not want to restore the entire post table beacause i would loose post in the past 3 weeks
can anyone help me with a script or anything i can used to extract post of the post table where the poster id is 1
here is a sample

INSERT INTO `ibf_posts` VALUES (2, 0, NULL, 1, 'albertldee', 1, 1, '12.8.34.199'
INSERT INTO `ibf_posts` VALUES (3, 0, NULL, 4, 'Þ®ÍÑ¢ê-ÄѤ', 1, 1, '207.44.154.35
INSERT INTO `ibf_posts` VALUES (4, 0, NULL, 6, 'demarcus', 1, 1, '69.142.131.149
INSERT INTO `ibf_posts` VALUES (5, 0, NULL, 7, 'gottasteu', 1, 1, '65.12.169.41

the post table has about 122000 line like above i just want to extract all the line that has albertldee like line number 1
Reply With Quote
  #2 (permalink)  
Old 09-17-04, 13:13
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
Cool

Try something like:
Code:
INSERT INTO ibf_posts 
SELECT * FROM ibf_posts_backup
 WHERE user_id = 'albertldee';
NOTE: Change user_id to the correct column name.

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #3 (permalink)  
Old 09-17-04, 23:49
albertldee albertldee is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
thanks but how do i set it up

thanks but how do i set it up
Reply With Quote
  #4 (permalink)  
Old 09-18-04, 09:12
albertldee albertldee is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
or can anyone tell me how can i setup a query to check a table and insert a line if it's not already exist
Reply With Quote
  #5 (permalink)  
Old 09-20-04, 09:12
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
Talking

Post a description of both the 'ibf_posts' and the backup table.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On