Cooper94 Posted February 12, 2009 Share Posted February 12, 2009 Ok I want it so when a person joins my website they will be assigned something called a callsign which is more or less like numbers and letters. I would like the system to automatilcy know what "callsign" is next on the line so say the last person who joined got the "callsign" RPA100 so the next person who joins is it possible for the system to know to set the next user who joins too RPA101? I hope I made this clear enough if not please say so and will answer them to the best of my ability. Thank You Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/ Share on other sites More sharing options...
metrostars Posted February 12, 2009 Share Posted February 12, 2009 Just make the cell where the number is stored in the database an autonumber and then add the ICAO code when the script is called instead of storing the whole string. Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-760692 Share on other sites More sharing options...
Cooper94 Posted February 12, 2009 Author Share Posted February 12, 2009 If you can tell me how to do this that would be great! Thank You Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-760710 Share on other sites More sharing options...
Q695 Posted February 12, 2009 Share Posted February 12, 2009 do a mysql primary key auto increment, and use that as the session id. Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-760715 Share on other sites More sharing options...
Cooper94 Posted February 12, 2009 Author Share Posted February 12, 2009 Session ID? Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-760729 Share on other sites More sharing options...
Q695 Posted February 13, 2009 Share Posted February 13, 2009 create session: $_SESSION[id]=$id; pull log in session id: session_start(); session_register($id); $id = $_SESSION[id]; Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-761063 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 session_register is deprecated. Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-761065 Share on other sites More sharing options...
Q695 Posted February 13, 2009 Share Posted February 13, 2009 How do you run sessions then, because it wouldn't work otherwise when I was doing it? Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-761075 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 Uhhh.... What version of PHP are you using? It shouldn't require that. $_SESSION and session_register shouldn't be mixed. In $id = $_SESSION[id]; by the way, id should be 'id' since unquoted strings are assumed to be constants, and there is not an id constant. Session_register is deprecated as of PHP 5.3 and it will not be included in PHP6. $_SESSION became the preferred method in what ever version of PHP it was added, and how I understand it, session_register is there now for compatibility. Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-761079 Share on other sites More sharing options...
Cooper94 Posted February 13, 2009 Author Share Posted February 13, 2009 I thought sessions were used when a member is logged in ??? I am not sure if you understand my question I would like to know how would it know what "callsign" to make it when someone REGISTERS with the site. Basicly istead of the admin chosing it when they accept them it is already chosen by the system. Say the last person was marked as RPA100 the next would be RPA101. Thank You Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-761348 Share on other sites More sharing options...
Q695 Posted February 13, 2009 Share Posted February 13, 2009 Shopping carts also use a session based system. you could do a row count +1 when they register. Quote Link to comment https://forums.phpfreaks.com/topic/144962-automatic-numbers/#findComment-761427 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.