swamp Posted September 13, 2008 Share Posted September 13, 2008 Hey, I've got a field called position, the default is currently 1. You can change the position using up + down form controls. Whem I submit a new row to the database through a form I want the field position to default to the lowest current position and be one less than that... Eg <input type="hidden" value=<?php echo $lowest_position - 1 ?>"> and: $lowest_position - LOWEST CURRENT POSITION - 1; Link to comment https://forums.phpfreaks.com/topic/124017-finding-lowest-number/ Share on other sites More sharing options...
DarkWater Posted September 13, 2008 Share Posted September 13, 2008 INSERT INTO table (something, name, position) VALUES ('testing!', 'DarkWater', MIN(position) - 1); Yeah. Link to comment https://forums.phpfreaks.com/topic/124017-finding-lowest-number/#findComment-640277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.