Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Split Topic backslash problem using MySQL database
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

samyot
Junior Member

Canada
242 Posts

Posted - 07 March 2005 :  11:59:56  Show Profile  Visit samyot's Homepage  Send samyot a Yahoo! Message
Hi,

I just installed this MOD, very useful by the way!

I noticed that if splitting a reply with a \ (backslash), then new topic has it removed! On some replies, the backslash actually gives an error...
--------------------------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'

[MySQL][ODBC 3.51 Driver][mysqld-4.0.22-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '20050307114910', 1, 0(

/forum/post_info.asp, line 1062
--------------------------------------------------------------------

I am assuming this is because I am using a MYSQL database!

Sylvain Amyot
Forum | Home

MY OTHER SITES:
http://www.mypcsecurity.ca
http://www.mynature.ca
http://www.myworkshop.ca
http://www.toptechsites.com
http://www.topsportsites.com
http://www.mysportsforums.net

samyot
Junior Member

Canada
242 Posts

Posted - 07 March 2005 :  12:34:58  Show Profile  Visit samyot's Homepage  Send samyot a Yahoo! Message
I got it working by adding in post_info.asp:

'Insert reply info as new topic into Topic table
strSql = "INSERT INTO " & strTablePrefix & "TOPICS (FORUM_ID"
strSql = strSql & ", CAT_ID"
strSql = strSql & ", T_SUBJECT"
strSql = strSql & ", T_MESSAGE"
strSql = strSql & ", T_AUTHOR"
strSql = strSql & ", T_LAST_POST"
strSql = strSql & ", T_LAST_POST_AUTHOR"
strSql = strSql & ", T_LAST_POST_REPLY_ID"
strSql = strSql & ", T_DATE"
strSql = strSql & ", T_STATUS"
strSql = strSql & ", T_IP"
strSql = strSql & ", T_STICKY"
strSql = strSql & ", T_SIG"
strSql = strSql & ", T_ARCHIVE_FLAG"
strSql = strSql & ", T_REPLIES"
strSql = strSql & ", T_UREPLIES"
strSql = strSql & ") VALUES ("
strSql = strSql & NewForumID
strSql = strSql & ", " & NewCatID
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & ChkString(Reply_Message,"sqlstring") & "'"
strSql = strSql & ", " & Reply_Author
strSql = strSql & ", '" & Reply_Date & "'"
strSql = strSql & ", " & Reply_Author
strSql = strSql & ", 0"
strSql = strSql & ", '" & Reply_Date & "'"
strSql = strSql & ", 1"
strSql = strSql & ", '" & Reply_IP & "'"
strSql = strSql & ", 0"
strSql = strSql & ", " & Reply_Sig
strSql = strSql & ", 1"
strSql = strSql & ", 0"
strSql = strSql & ", 0)"


Can someone verify this is OK?

Sylvain Amyot
Forum | Home

MY OTHER SITES:
http://www.mypcsecurity.ca
http://www.mynature.ca
http://www.myworkshop.ca
http://www.toptechsites.com
http://www.topsportsites.com
http://www.mysportsforums.net
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 March 2005 :  14:42:18  Show Profile
I'm using mysql and I am not having that problem.

The replies are already stored in your database. If someone originally made a post with a backslash, it would be stored with 2 blackslashes in mysql \\. So all that is needed would be to copy the contents of the post into the topic table.

If you pass it through the sqlstring function, you're going to end up with double quotes in your posts.

Are you sure it's the backslash that is giving the problem?
Can you post a copy of the message so I can test it? Or put it in a txt file and post a link to the file.

Support Snitz Forums
Go to Top of Page

samyot
Junior Member

Canada
242 Posts

Posted - 07 March 2005 :  14:55:09  Show Profile  Visit samyot's Homepage  Send samyot a Yahoo! Message
quote:
Originally posted by Davio
Can you post a copy of the message so I can test it? Or put it in a txt file and post a link to the file.

I am not quit sure what message you're refering to.

Sylvain Amyot
Forum | Home

MY OTHER SITES:
http://www.mypcsecurity.ca
http://www.mynature.ca
http://www.myworkshop.ca
http://www.toptechsites.com
http://www.topsportsites.com
http://www.mysportsforums.net
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 March 2005 :  15:03:20  Show Profile
The reply message that the error is reffering to. The message that has the backslash.

Support Snitz Forums
Go to Top of Page

samyot
Junior Member

Canada
242 Posts

Posted - 07 March 2005 :  15:29:37  Show Profile  Visit samyot's Homepage  Send samyot a Yahoo! Message
The error would happen to any test messages containing only a backslash
But if the \ was like this c:\windows, the split message was c:windows (without any errors)

I understand what your saying that the message is stored in the MySQL db with 2 backslashes but for some reason was happening.

Since I got it working with the changes I did above don't spend too much time on this!

Davio, I appreciate all the help!

I did start a new thread with another problem at http://forum.snitz.com/forum/topic.asp?TOPIC_ID=57386

Sylvain Amyot
Forum | Home

MY OTHER SITES:
http://www.mypcsecurity.ca
http://www.mynature.ca
http://www.myworkshop.ca
http://www.toptechsites.com
http://www.topsportsites.com
http://www.mysportsforums.net

Edited by - samyot on 07 March 2005 15:30:59
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 March 2005 :  15:45:02  Show Profile
quote:
Since I got it working with the changes I did above don't spend too much time on this!
Ok, how about you test a post with a single quote ' in your posts. Split them and see if you end up with double quotes.

Support Snitz Forums
Go to Top of Page

samyot
Junior Member

Canada
242 Posts

Posted - 07 March 2005 :  15:53:58  Show Profile  Visit samyot's Homepage  Send samyot a Yahoo! Message
Single quotes work fine.

Sylvain Amyot
Forum | Home

MY OTHER SITES:
http://www.mypcsecurity.ca
http://www.mynature.ca
http://www.myworkshop.ca
http://www.toptechsites.com
http://www.topsportsites.com
http://www.mysportsforums.net
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 March 2005 :  15:55:37  Show Profile
Very strange, as that was the problem before with access users. I'm puzzled. Will have to test it again.

Support Snitz Forums
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07