markvaughn2006 Posted September 26, 2009 Share Posted September 26, 2009 Is there a way to set a maximum number in a field that is an integer?? example - Field name is Energy, every 15 minutes 1 is added to Energy until 100 is reached. Thanks for any help!! Link to comment https://forums.phpfreaks.com/topic/175646-setting-a-maximum-in-an-integer-field/ Share on other sites More sharing options...
khr2003 Posted September 27, 2009 Share Posted September 27, 2009 is 1 added to the database? then make a query and check the number. $query = mysql_query("Select * from tablename"); $row = mysql_fetch_row($query); if($row['energy'] == 100) { echo "We have reached the maximum entry allowed"; } Link to comment https://forums.phpfreaks.com/topic/175646-setting-a-maximum-in-an-integer-field/#findComment-925614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.