i have the page and am making the changes you suggested.
"Just before the query add <cfdump var="#memberid#"> and see what it says."
it throws up the correct value of the memberid at the top left of the page.
"<cftry>
<cfquery name="updateHits" datasource="#DSN#"> UPDATE Members SET ViewCount=
ViewCount + 1 WHERE MemberID= #memberid# </cfquery>
<cfcatch type="any">
<!--- error --->
</cfcatch>
</cftry>"
i have done this now and you're right the error has been trapped and the
page works WITHOUT incrementing the counter.
any ideas on how i can tweak this poor counter incrementing code to get the
counter to work?
cheers buddy ;-)
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Saturday, June 02, 2007 11:56 AM
To: CF-Newbie
Subject: Re: Hits Counter upgrade from CFMX6 to CFMX7
Do you have the page? Can you access it?
Just before the query add <cfdump var="#memberid#"> and see what it says.
Where is thus value being set? What is it
If you want to stop it from erroring on screen change the code to be this
for now..
<cftry>
<cfquery name="updateHits" datasource="#DSN#"> UPDATE Members SET ViewCount=
ViewCount + 1 WHERE MemberID= #memberid# </cfquery>
<cfcatch type="any">
<!--- error --->
</cfcatch>
</cftry>
It will trap the error and the page will work .
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540. It contains information which is
confidential and may also be privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910. The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com
-----Original Message-----
From: [EMAIL PROTECTED]
To: CF-Newbie
Sent: Sat Jun 02 09:45:19 2007
Subject: RE: Hits Counter upgrade from CFMX6 to CFMX7
cheers for the response neil -
"Did you change DB?"
i don't understand what you are saying, did i change DataBase??
"You will also want to use cfqueryparam for you values in."
lost me here as well buddy!
"Who did the site for you?"
someone back 3 years ago who i just cannot get a hold of anymore!
how is it that this worked for CFMX6 and below and now CFMX7 just doesn't
like it!
"Probably failing here:
SET ViewCount=ViewCount + 1"
i thought the error message highlighted the following synatx as the error
point:
WHERE MemberID=#memberid#
if it helps, i have a table in which i have a field called "ViewCount" and
this field gets updated everytime the above script tis processed.
cheers, and any further help will be much appreciated ;-)
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Saturday, June 02, 2007 11:12 AM
To: CF-Newbie
Subject: Re: Hits Counter upgrade from CFMX6 to CFMX7
Probably failing here:
SET ViewCount=ViewCount + 1
Did you change DB? Having a hit counter like this is pretty poor use of DB
time and you would be better off getting some kind of simple stats package
in place (perhaps Google)
You will also want to use cfqueryparam for you values in.
Who did the site for you?
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540. It contains information which is
confidential and may also be privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910. The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com
-----Original Message-----
From: [EMAIL PROTECTED]
To: CF-Newbie
Sent: Sat Jun 02 08:46:12 2007
Subject: Hits Counter upgrade from CFMX6 to CFMX7
Hi -
I have the following hit counter which has been working in all versions of
coldfusion upto and including CFMX6. I have now changed my hosting to a new
company and they are running CFMX7 and my hit counter code is kicking up an
error:
<cfquery name="updateHits" datasource="#DSN#">
UPDATE Members
SET ViewCount=ViewCount + 1
WHERE MemberID=#memberid#
</cfquery>
I get the following error:
Error Occurred While Processing Request
Error Executing Database Query.
Syntax error: Stopped parse at .
The error occurred in viewmember.cfm: line 30
28 : UPDATE Members
29 : SET ViewCount=ViewCount + 1
30 : WHERE MemberID=#memberid#
31 : </cfquery>
32 :
I am not a CF programmer so my knowledge is very limited, but does anyone
know a workaround to this problem in CFMX7?
Cheers in anticipation of some assistance ;-)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2791
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15