Hello guys I'm stucked at this point. So I need your help, thanks anyway.
I'm using this code to count rows and trying to do IF num rows equals to ZERO do INSERT if not UPDATE but doesnt works. When I use "==" operator nothing happens, if I use ">=" operator script inserting the values but running insert query on every refresh and values are duplicating in mysql table. here is the code, whats wrong with this thing? thank you.
$isexist = mysql_query("select count(*) from wcddl_filehosts where downloadid = '".$download[id]."'");
if (mysql_num_rows($isexist) == 0) {
mysql_query("insert into wcddl_filehosts (downloadid, rs) values ('".$download[id]."','$totalRS')");
} else {
mysql_query("update wcddl_filehosts set rs = '$totalRS' where downloadid = '".$download[id]."'");
}