Siemka mam coś takiego:
$jest = mysql_query("select c from tab where c=".$v.";");
if($jest == null){
$query="insert into tab(c,ilosc) values(".$v.",0);";
print "niebylo";
}
else {
$query="update tab set ilosc = ilosc+1 where c=".$v.";";
print "bylo";
}
czy ten null może tak być czy coś innego sie powinno wstawiac jak nic tabela nie zwraca?