T O P I C R E V I E W |
Carefree |
Posted - 11 March 2013 : 12:20:54 This has come up a number of times over the years and, as far as I know, nobody has done it. I'd be happy to code it but I'm hitting a mental block as to the best way. Anyone have any suggestions? |
15 L A T E S T R E P L I E S (Newest First) |
Carefree |
Posted - 07 April 2015 : 16:23:30 Heard that someone experienced an error. Please, either post a link to your "topic.asp" in .txt format for me to see, or reply here and surround your "topic.asp" with [scrollcode][/scrollcode].
Resolved. Had code blocks in wrong place. |
Carefree |
Posted - 03 April 2015 : 22:51:08 Well, no change, still failed. Back to the drawing board.
Redid the routines in "topic.asp" and the "pop_thanks.asp" on SnitzBitz. They will now work with all. |
ruirib |
Posted - 03 April 2015 : 17:44:47 quote: Originally posted by Carefree
Well, I previously only had group by member_id since that was the only selected field ... that didn't work, same error. So I guess I need to put all three fields in the first select as well as in the distinct select?
Yes, you need to have all three fields in the SELECT clause.The fields are needed in the query that has the GROUP BY clause but here, since you are SELECT from the subquery, the subquery needs the three fields as well, or they wouldn't be in the main query, to start with.
With a single Group By field, and that field present in the SELECT clause, I don't see why the query would fail. |
Carefree |
Posted - 03 April 2015 : 16:57:10 Well, I previously only had group by member_id since that was the only selected field ... that didn't work, same error. So I guess I need to put all three fields in the first select as well as in the distinct select? |
ruirib |
Posted - 03 April 2015 : 13:15:38 In SQL Server, fields in a Group By clause need to be included in the SELECT clause, as well. There are some exceptions to this, but they don't apply to your case. |
Carefree |
Posted - 03 April 2015 : 10:18:13 OK. There's a SQL 'GROUP BY' syntax error on lines 20/50 (in red) below. It works fine with MS Access, but MS SQL gets the hiccups. Can anyone spot a problem?
|
Carefree |
Posted - 03 April 2015 : 06:10:58 Discovered that screen refreshing can cause thanks counter to increase, so modified code to use "select distinct". Get the update on SnitzBitz. |
Carefree |
Posted - 12 March 2015 : 19:57:30 You don't need to worry about the Thanks_ID. It's not necessary for the mod as it stands now. So auto-increment isn't a factor. |
Webbo |
Posted - 12 March 2015 : 13:20:27 I thought I'd found the problem and that is with the way that the database was set up as MySql apparently doesn`t like Auto Increment unless the column is Primary
However changing the database table 'thanks' to add auto increment resulted in the following error and also the author of the post below the one I chose to 'thank' being thanked ....
quote: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 5.1 Driver][mysqld-5.1.73-community]Duplicate entry '180108' for key 'PRIMARY'
/forum/topic.asp, line 946
There are three instances where loops are created and they are within the 'Polls' mod code and the 'Active Users' mod code, line 182, 1107 and 1135
|
Carefree |
Posted - 11 March 2015 : 20:31:23 You have a loop someplace. It definitely won't do that the way I wrote it. I tested this on a pristine (virgin) Snitz installation and it works perfectly. Look for something like this (surrounding the Thanks code).
For i = 1 to 4
or
Do while
or
Do until
|
Webbo |
Posted - 11 March 2015 : 17:48:32 Okay,
starting with a new file and the changes above....
when thanking the initial post in the topic I get the following error in the first reply and no other replies show...
quote: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 5.1 Driver][mysqld-5.1.73-community]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 ')' at line 1
/forum/topic.asp, line 945
Emptying the table (thanks) to start again....
If I 'thank' the first reply in the thread it works
However if I 'thank' the initial post or subsequent replies, whilst they add 1 'thanks' to that it adds a further 4 thanks to the first reply also, and the table in the database looks like this...
|
Carefree |
Posted - 11 March 2015 : 17:25:32 Is anyone else running this on a MySQL database? If so, are you experiencing the errors that Webbo has? |
Carefree |
Posted - 11 March 2015 : 17:23:37 The code isn't the same for both sections. One is for topics, the other for replies. This is the 940 block:
This is the 1380 block:
When you thank the topic, do you get an error? |
Webbo |
Posted - 11 March 2015 : 16:41:04 Replacing the first block of code resulted in the following error...
quote: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 5.1 Driver][mysqld-5.1.73-community]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 ')' at line 1
/forum/topic.asp, line 948
Replacing both blocks of code with the same caused the thread not to display and the initial post to be replaced with an error |
Carefree |
Posted - 11 March 2015 : 16:24:23 It should work fine the way it is, but it's misbehaving. Replace that block of code with this, maybe MySQL will not hiccup.
|
|
|