cdog5000 Posted August 11, 2008 Share Posted August 11, 2008 ok.. i have this here: mysql_query("UPDATE authTable SET minerMinutesLeft=minerMinutesLeft+10000 WHERE username = '$username'"); but it only set's the minutes to 10000... i need some help plz Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/ Share on other sites More sharing options...
tibberous Posted August 11, 2008 Share Posted August 11, 2008 That works. Either minerMinutesLeft isn't a number type, or it's 0, or your fucking it up somehow. Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/#findComment-613190 Share on other sites More sharing options...
cdog5000 Posted August 11, 2008 Author Share Posted August 11, 2008 That works. Either minerMinutesLeft isn't a number type, or it's 0, or your fucking it up somehow. no... it isn't working and i even made sure that it was working...and it's a type of int.... Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/#findComment-613192 Share on other sites More sharing options...
unrelenting Posted August 11, 2008 Share Posted August 11, 2008 Have you looked in the database and verified what the integer is to begin with before 10000 is added to it? Is the minerMinutesLeft column set as integer or do you have it set as a varchar or something? Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/#findComment-613195 Share on other sites More sharing options...
cdog5000 Posted August 11, 2008 Author Share Posted August 11, 2008 Field Type Null Default minerMinutesLeft int(11) No 1 Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/#findComment-613196 Share on other sites More sharing options...
PFMaBiSmAd Posted August 11, 2008 Share Posted August 11, 2008 Add some error checking to get mysql/php to tell you if the mysql_query() is being executed without error - mysql_query("UPDATE authTable SET minerMinutesLeft=minerMinutesLeft+10000 WHERE username = '$username'") or die("Update query failed: " . mysql_error()); Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/#findComment-613200 Share on other sites More sharing options...
cdog5000 Posted August 11, 2008 Author Share Posted August 11, 2008 Add some error checking to get mysql/php to tell you if the mysql_query() is being executed without error - mysql_query("UPDATE authTable SET minerMinutesLeft=minerMinutesLeft+10000 WHERE username = '$username'") or die("Update query failed: " . mysql_error()); ok... i found out it was a simple syntax error in my username Link to comment https://forums.phpfreaks.com/topic/119089-solved-a-bit-of-math/#findComment-613203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.