[dx] Posted April 17, 2012 Share Posted April 17, 2012 Hi, I'm using this SQL statement but it updates twice. I'm sure that this line is writtent just on one place in whole page. mysql_query("INSERT INTO clicks (year, ".strtolower(date('M')).") VALUES ('".date('Y')."', '1') ON DUPLICATE KEY UPDATE ".strtolower(date('M'))."=".strtolower(date('M'))."+1"); So it works fine just instead of it is doing increment by 2. I've tried standard mod with select, checking update if num rows > 0, or else insert. Like it calls statement twice. Can it be some error with mysql? Link to comment Share on other sites More sharing options...
birbal Posted April 17, 2012 Share Posted April 17, 2012 do you mean in increment in auto incremented field? Link to comment Share on other sites More sharing options...
[dx] Posted April 17, 2012 Author Share Posted April 17, 2012 No, at this part. ".strtolower(date('M'))."=".strtolower(date('M'))."+1" Link to comment Share on other sites More sharing options...
[dx] Posted April 18, 2012 Author Share Posted April 18, 2012 Hi, Just a hint to anyone who get stuck with this problem. Check does your page tries to load some element which is empty. In my case that was <link rel="shortcut icon" href="/favicon.ico"> but favicon.ico wasn't located at server. After I've added it, it started working normal. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.