Help needed in mysql
Collapse
X
-
Originally posted by amitdas333 View PostI want to add all the clicks & impressions and show itModify it how you wantPHP Code:$query = mysql_query("SELECT column FROM table_name WHERE id = $id");
$result = mysql_num_rows($query);
if($result > 0)
{
$count = 0;
while($row = mysql_fetch_array($query))
$count += $row[0];
echo $count;
}
Last edited by s3nzo; 27.06.12, 11:37.
Leave a comment:
-
I think you had used ad4earn script, in the created ad section it shows clicks & impressions of each ad separatly.Originally posted by razzbee View PostI am sorry but I dont seem to understand ur question,
If i am not mistaking : you can try this :
"SELECT COUNT(*) FROM table_name";
I want to add all the clicks & impressions and show it. Hope you have understand.
BTW your coupon for kloudserve is not working.
Leave a comment:
-
its better to count any single column then distinct
SELECT COUNT(id) FROM table_name
Leave a comment:
-
I am sorry but I dont seem to understand ur question,
If i am not mistaking : you can try this :
"SELECT COUNT(*) FROM table_name";
Leave a comment:
-
Help needed in mysql
Hi! Can anybody help me, i want to add the results of mysql_num_rows.
$ad = ("SELECT * from campaigns WHERE id=$id)
$result = mysql_num_rows($ad);
I wand to sum all the result. For example, if there are 5 results-
10
20
5
9
16
echo $result;
It will show 5 result. I want to add all 5 results & show 60 as the result.
I google a lot but couldn't get the answer. Plz help!!Tags: None
Leave a comment: