Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 SQL query on Topic name help

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
StephenD Posted - 25 October 2006 : 06:07:25
I've got a relatively small sized db now with 3850 topics. The topic name is unique in that I append a case no. to the end of the topic name that looks like: 4356/2006 or 4357/2006.

What I am trying to do is when posting a new topic (case) I query the db and display in post.asp the next available case no based on the highest number in the first part of that case no. + 1 so in the above example 4358/2006 will be the next suggested case no.

Then again I suppose I could create a new table with autonumber starting at last case no. linked to topic_id that I would insert a record into same time the topic gets posted, then upate forum_topics T_SUBJECT with the appended case no.

SELECT T_SUBJECT INTO FORUM_TEMPXX FROM FORUM_TOPICS WHERE RIGHT(T_SUBJECT,1)='6'
UPDATE FORUM_TEMPXX SET T_SUBJECT = RIGHT(T_SUBJECT,9)
UPDATE FORUM_TEMPXX SET T_SUBJECT = LEFT(T_SUBJECT,4)<
1   L A T E S T    R E P L I E S    (Newest First)
HuwR Posted - 25 October 2006 : 06:23:30
quote:
Then again I suppose I could create a new table with autonumber starting at last case no. linked to topic_id that I would insert a record into same time the topic gets posted, then upate forum_topics T_SUBJECT with the appended case no.

This would be the prefered way to do it, rather than parsing the text of the subject in your query.<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000 Version 3.4.07