Samurai Legend Posted January 6, 2015 Share Posted January 6, 2015 Hello MWG! I have a slight problem. So the Mugger of the hour Sniko made whenever someone mugs someone a new insert in the table happens instead of updating the table. Even if there is already a table for the user? [ATTACH=CONFIG]1782[/ATTACH] Code - $objThisHour = $db->query("SELECT `uid` FROM `mugger_oth` WHERE `uid` = ". $userid ." AND `date_start` LIKE DATE_FORMAT(NOW(), '%Y-%m-%d %k')"); if($db->num_rows($objThisHour) > 0) { $db->query("UPDATE `mugger_oth` SET `total_mugged` = `total_mugged` + ". $stole .", `total_mugs` = `total_mugs` + 1 WHERE `uid` = ". $userid ." AND `date_start` LIKE DATE_FORMAT(NOW(), '%Y-%m-%d %k')"); } else { $db->query("INSERT INTO `mugger_oth` (`uid`,`total_mugged`,`date_start`, `total_mugs`) VALUES (". $userid .", ". $stole .", NOW(), 1)"); } Quote Link to comment Share on other sites More sharing options...
Coly010 Posted January 6, 2015 Share Posted January 6, 2015 Havent used this mod, but from looking at that, i'd assume it might be something to do with LIKE DATE_FORMAT(NOW(), '%Y-%m-%d %k') however, that saying, it could be the part where it actually prints the users to the page where the error is occuring Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.