Jump to content

Counting Problem


xsubs

Recommended Posts

I'm trying to add 1 to a counter everytime that the page is loaded.

This is my function code:

function FileWrite($sign, $act, $id) {
  include("./Configs/Config.php");


  $action = array('Plus' => '+','Minus' => '-');
  if (!mysql_query("UPDATE Text SET $act = $act{$action[$sign]}1 WHERE id = '$id'")) {
    return false;
  }
  if (!mysql_query("UPDATE Total SET $act = $act{$action[$sign]}1")) {
    return false;
  }
  return true;
}

It is counting well, but sometimes it just going crazy.

like here:

screenshotoi8.jpg

 

What can i do to solve it?

It's very urgent. Ty!

Link to comment
https://forums.phpfreaks.com/topic/75172-counting-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.