Sorry thinkdreams, still did not work. I did all the changes carefully in .htaccess and zp_config.php to switch off mod_rewrite. Anyway, at least we know that it will work perfectly (with mod_rewrite ON and without full URL) of we insert:
if (mysql_num_rows($query) == 0) {
$sql = "INSERT INTO $tableName (id,
total_votes, total_value, used_ips)
VALUES ('$id', '0', '0', '')";
$result = mysql_query($sql);
}
After the line:
$query=mysql_query("SELECT total_votes, total_value, used_ips FROM $tableName WHERE id='$id' ")or die(" Error: ".mysql_error());