Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2007, 09:15 AM
Authorized User
 
Join Date: Apr 2007
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update Query to add a count of +1

Hi All.

I have a field called "logincount". I cant figure out the query for mySQL to run to simply update the current number in that field to add "1" to it.

So for example, if the last login was 34, I need it to change to 35 when logged in.
Here is my current query:

sql= "update customerlogin Set logincount = logincount +1" & logincount &"' WHERE email='" & email &"' "

I GET SYNTAX ERRORS.

 
Old August 7th, 2007, 09:28 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

Yes it is incorrect. Change it to follow:

sql= "update customerlogin Set logincount = logincount + 1 " & "WHERE email='" & email &"'"
 
Old August 7th, 2007, 10:19 AM
Authorized User
 
Join Date: Apr 2007
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you! worked perfectly. I see what I did now. Thank you ever so much.

 
Old August 7th, 2007, 11:59 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

You are welcome.





Similar Threads
Thread Thread Starter Forum Replies Last Post
new display count query carswelljr SQL Language 9 May 7th, 2007 04:59 PM
UPDATE from COUNT(*) in another table. jlrolin SQL Language 1 March 20th, 2007 01:57 AM
query count? Raif Access 1 June 18th, 2004 05:08 PM
count clause in query mateenmohd SQL Server 2000 2 June 10th, 2004 01:47 AM
SQL query for count programmer_kay ADO.NET 1 April 18th, 2004 02:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.