I did search for answer before I posted :) !
Now my problem is php mysql script have to count records in mysql database cells I will try to draw my db now
table name: tableurl (table contains two columns url and clicks)
----------------
url clicks
clhgfghfh 6
hgjhgjhgh 0
kjhgjhgjh 0
khgjhgjhg 1
asdasddsg 5
-----------------
Now I want to count all the clicks so output should be 12 ! here is my code
<?php
/* db connection included in head*/
$sql ="SELECT count(clicks) FROM tableurl";
if ($result=mysqli_query($con,$sql))
{
$rowcount=mysqli_num_rows($result);
printf("Clicks together %d \n",$rowcount);
mysqli_free_result($result);
}
?>
P.S. clicks in db is defined as INT lenght/value is 1 default is NULL
Any input what I'm doing wrong ?
mysqli_num_rowscounts the rows returned from the db, so it correctly says1