0

Hello!
I have a counter to count personal page views for users, but when the counter in the table is updated (incremented by 1)it also updates the date. Anyone know if the counter column can be updated without updating the date? Also, I need to have an update date for other updates.
Thanks

2
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by phpDave
0
mysql_query("UPDATE users INNER JOIN content SET counter = counter + 1 WHERE xyz = '$colname_Recordset1' ");
0

And which date is getting updated that you don't want? Are you referring to a column, or something else?

0

Thanx for your response.
In my table I have a column for a date. Every time a user updates his or her page the date gets updated. Also, every time someone else views his or her page a counter in the same table increments by one. The problem is that when the counter gets updated so does the date.

What I would like to do is let the counter increment by 1 without the date getting updated.

I tried to put the counter in the users table but then the counter in every row gets incremented by 1.

0

Then you'll need to change the column type. You can just make it a regular int, then if you want to update the time, use something like this:

$time = time();
$query = "UPDATE Table SET time='$time' WHERE condition='mycondition' ";

Edited by Lsmjudoka: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.