Add results from MySQL?
- by NardCake
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!