Deleted User 295 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 * Link to comment Share on other sites More sharing options...
0 Daffy 8 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 jak ti toto muze neco napsat do DB ? Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 8. Únor, 2010 Author Share Odesláno: 8. Únor, 2010 * Link to comment Share on other sites More sharing options...
0 Daffy 8 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 porad nechapu co chces aby to udelalo. co mas v tabulce 'users' ? tam mas zapsane uplne vsechny porty ? edit jo uz to asi chapu , ... Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 8. Únor, 2010 Author Share Odesláno: 8. Únor, 2010 * Link to comment Share on other sites More sharing options...
0 Daffy 8 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 tak pouzij AUTO_INCREMENT ne ? jako primary key. tzn ze se bude pricitat porad 1. auto_increment nastav na 7777 ... tedy CREATE TABLE `users` ( `port` int(100) NOT NULL auto_increment,PRIMARY KEY (`port`) ) AUTO_INCREMENT=7777 ; Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 8. Únor, 2010 Author Share Odesláno: 8. Únor, 2010 * Link to comment Share on other sites More sharing options...
0 Daffy 8 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 ale jde to pod ID Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 8. Únor, 2010 Author Share Odesláno: 8. Únor, 2010 * Link to comment Share on other sites More sharing options...
0 Daffy 8 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 to auto_increment nastav userum jako jejich ID, dle necj pouzij funkci mysql_insert_id, tabulku `port` pouzij normalne. a trebas sem narychlo ti napsal takovou funkci nejak takto logicky dle posledniho zaznamu... function _PosledniPort() { $query = mysql_query("SELECT LAST_INSERT_ID() FROM `users`") or die("error"); $array = mysql_fetch_array( $query ); //------------ if($array) { return $array["port"]; } } tedy <?php echo _PosledniPort(); // posledni echo " "; // konec radku echo _PosledniPort()+1; // nasledujci Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 8. Únor, 2010 Author Share Odesláno: 8. Únor, 2010 * Link to comment Share on other sites More sharing options...
0 Daffy 8 Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 omg, tak si udelej v php funkce ktera vyhleda nizzsi zaznam, pokud nenajde do urcite meze, hleda vyssi. Link to comment Share on other sites More sharing options...
0 Guest Mikeses Odesláno: 8. Únor, 2010 Share Odesláno: 8. Únor, 2010 auto_increment, unique Link to comment Share on other sites More sharing options...
Dotaz
Deleted User 295
*
Link to comment
Share on other sites
12 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now