Hi, I am making a personal project like so: I enter something in the text box (eg. "PHP REALLLLLLY ROCKS!!!") then the program checks if that string already exists in the database, if no, then it should enter it into the database and also generate a "key" This key can be given to pals and they can read the "secret message"
Key: Key should first be 1-1000 then a-z then A-Z then axxx (eg: a001, the xxx will always be numbers) once it reaches 999 it should become Axxx then b then B etc after a,A,b,B are done it should go for aaxx,AAxx etc always 4 characters A few questions: 1.Looking at the above (database part) I figured that doing this via a mysql database would be better rather than a text database...do you agree? 2.I was thinking of making the "key" field a primary key and unique and indexed....right? 3.The way I see it theres 3 sql statements that need to be run, a) connect and see if string exists b)read the last key c)write to the database...anyway to break the above to 2 statements or am I following this wrong? 4. Logic for the key, I am coming up with crummy logic to make the "key", basically a block of code for 1-1000,another block for a-z another block for A-Z etc...... any ideas,links,URLs or code snippets off the top of your head would be greatly appreciated. Thanks in advance. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php