calmchess Posted December 12, 2009 Share Posted December 12, 2009 I have check printing software and need to print a check number for each row in mysql database which shouldn't be too difficult but each pay period the checks go out and the number needs to increment by one....each row should also be using a unique number i've tried to do it a bunch of diffrent ways but always come up short........I'm using php could sombody help me write a nice check numbering system.I'd be entirely grateful. Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/ Share on other sites More sharing options...
fenway Posted December 14, 2009 Share Posted December 14, 2009 Based on what? Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/#findComment-977299 Share on other sites More sharing options...
calmchess Posted December 19, 2009 Author Share Posted December 19, 2009 I don't know what its based on I'm just looking for somebody with an idea on how to write a check numbering system in a mysql database.....you see i query all the users names and the financial data outputs to a csv file each entry in the database needs a uinque in sequence number....this is not an easy thing to dynamically create. any help would be greatly appriciated. Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/#findComment-980414 Share on other sites More sharing options...
premiso Posted December 19, 2009 Share Posted December 19, 2009 auto_increment is a basic part of rational databases. What you want is how a database should be setup, see the example linked for more information. Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/#findComment-980419 Share on other sites More sharing options...
calmchess Posted December 19, 2009 Author Share Posted December 19, 2009 auto increment isn't possible becasue username is the primary key because it must not have duplicates I'm looking to build a system similar to auto increment without using auto increment.....auto increment doesn't even solve my issue because you can't increment auto increment after its set. Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/#findComment-980420 Share on other sites More sharing options...
fenway Posted December 21, 2009 Share Posted December 21, 2009 Sorry, I have no idea what you're talking about. Give an example of what you would call a "check number". Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/#findComment-981294 Share on other sites More sharing options...
gizmola Posted December 21, 2009 Share Posted December 21, 2009 auto increment isn't possible becasue username is the primary key because it must not have duplicates I'm looking to build a system similar to auto increment without using auto increment.....auto increment doesn't even solve my issue because you can't increment auto increment after its set. You do not need to make username the primary key. You can simply set it to have a unique constraint, or define a unique index on username. You can then add a column called "id" or "checknumber" and define that to be the primary key/ with auto_increment. Quote Link to comment https://forums.phpfreaks.com/topic/184832-mysql-check-numbering-system-help/#findComment-981300 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.