Re: mySql updating numbers
- From: "Kevin" <kevin@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 19 Sep 2005 13:27:22 -0400
If I understand your question, you're looking for something like this:
UPDATE `my_table` SET hits = hits + 1 WHERE record_id = '$id'
Obviously you'll need to change the variable names to match your table, but
the point is you can use a column's current value in an update.
- Kevin
"Mikey P" <phatnugs420@xxxxxxxxxxx> wrote in message
news:1127142562.098174.249550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi, sorry to double post. I also need some direction on how to update
> mysql correctly when someone clicks a link it adds 1 to the database,
> if someone clicks again it ads 1 which = 2 hits. What's the proper way
> of doing this. Thanks again! - Mikey P.
>
.
- References:
- mySql updating numbers
- From: Mikey P
- mySql updating numbers
- Prev by Date: Re: Can I read/write to the Serial Port, Comm1 or Comm2 using PHP?
- Next by Date: Re: what am I doing wrong
- Previous by thread: mySql updating numbers
- Next by thread: Newbie installation, debugging, passing variables
- Index(es):
Relevant Pages
|