Add results from MySQL?
Posted
by
NardCake
on Stack Overflow
See other posts from Stack Overflow
or by NardCake
Published on 2012-09-29T21:35:07Z
Indexed on
2012/09/29
21:37 UTC
Read the original article
Hit count: 225
Not quite sure how descriptive that title was but this is what I want to do. I scripted a URL shortener today and it's working fine, I just want to add some stats on the bottom of it saying how many links there are and how many clicks there are. Now everytime a user clicks one of the links it +1 the column in the database then it redirects the user. I want to query that and add all of those numbers together from each row. I attempted a while loop which im not surprised didn't work:
while($rows = mysql_fetch_assoc($check_count)){
$clicks = $rows['clicks'];
$clicks = $clicks+$clicks;
}
If you don't understand please ask and if you do understand it means alot for any response!
© Stack Overflow or respective owner