ok - now i feel REALLY dumb!

the following code DOES work:

<cfquery name="updateHits" datasource="#DSN#">
UPDATE Members
SET ViewCount=ViewCount + 1 
WHERE MemberID=#memberid#
</cfquery>

....and it was THIS code which didn't:

<cfquery name="updateHits" datasource="#DSN#">
UPDATE Members
SET Members.ViewCount=Members.ViewCount + 1 
WHERE MemberID=#memberid#
</cfquery>

sorry for the confusion - it works fine, i had just not updated my coding
for this script - DOH!

sorry for wasting your time buddy. your response werte nevertheless MUCH
appreciated!

cheers!


-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 02, 2007 2:25 PM
To: CF-Newbie
Subject: Re: Hits Counter upgrade from CFMX6 to CFMX7

Well, only thing I can think of us that MemberID doesn't exist.



"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 12:22:57 2007
Subject: RE: Hits Counter upgrade from CFMX6 to CFMX7

hey now you come to mention it, i don't want that!

and you know what - i just checked and yeah it does update EVERYONE'S record
and this is NOT what i want!

damn!

previously you mentioned:

"Is the MemberID a numeric value? Us the MemberID column numeric?"

yes, the memberid is a numeric value, in fact it is the primary key.


 

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Saturday, June 02, 2007 1:53 PM
To: CF-Newbie
Subject: Re: Hits Counter upgrade from CFMX6 to CFMX7

Yeah, but that is updating the entire column for all members, not
incrememting an individuals count. If this is what you want to do then cool,
if not, why was the where clause present before?





"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 11:51:25 2007
Subject: RE: Hits Counter upgrade from CFMX6 to CFMX7

hey neil - thanks so much for getting back to me on this.

i also posted a help request here:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid
=3&threadid=1272935&enterthread=y

and it works out that the solution was as follows:

<cfquery name="updateHits" datasource="#DSN#"> UPDATE Members SET
ViewCount=ViewCount + 1 </cfquery>

.......so i really just needed to remove the WHERE clause and it worked fine!

tahnkyou SO much for your help in getting back to me with the different
possibilities, i really have appreciated it!

;-)

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Saturday, June 02, 2007 12:56 PM
To: CF-Newbie
Subject: Re: Hits Counter upgrade from CFMX6 to CFMX7

Do you have direct DB access to make a query against the DB?

I can't see a particular problem with the query block, especially since it
worked before. 

With the member I'd, try and modify the query to use the real MemberID
instead of the variable to see if it runs.

Is the MemberID a numeric value? Us the MemberID column numeric?





"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 10:47:17 2007
Subject: RE: Hits Counter upgrade from CFMX6 to CFMX7

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 ;-) 























~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2797
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to