krisis32 Posted February 5, 2011 Report Share Posted February 5, 2011 (edited) Sveiki! Tātad ir tabula: numbers +--------+------------------------+ | Number | Date | +--------+------------------------+ | 1 | 15/02/11-12:13 | | 2 | 15/02/11-12:13 | | 3 | 15/02/11-12:13 | | 4 | 15/02/11-12:13 | | 5 | | +--------+------------------------+ Kā lai izveidot skriptu kas updeito Number. Ir forma no kuras izvēlos Date un ievadu Number attiecīgajam Date. Ievadīto Number pieskaita jau esošajam. Update numbers ... ? Edited February 5, 2011 by krisis32 Quote Link to comment Share on other sites More sharing options...
forSilence Posted February 5, 2011 Report Share Posted February 5, 2011 (edited) Es darītu tā: mysql_query ("UPDATE tabula SET Number = Number+1 WHERE Date = $izveletais_date"); Edited February 5, 2011 by forSilence Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 5, 2011 Report Share Posted February 5, 2011 +--------+------------------------+ | Number | Date | +--------+------------------------+ | 1 | 15/02/11-12:13 | | 2 | 15/02/11-12:13 | | 3 | 15/02/11-12:13 | | 4 | 15/02/11-12:13 | | 5 | | +--------+------------------------+ Kā lai dabū tādu tekstuālu atspoguļojumu tabulai? =/ Quote Link to comment Share on other sites More sharing options...
krisis32 Posted February 5, 2011 Author Report Share Posted February 5, 2011 Es darītu tā: mysql_query ("UPDATE tabula SET Number = Number+1 WHERE Date = $izveletais_date"); Liels paldies. Paprovēšu šo te. Kā lai dabū tādu tekstuālu atspoguļojumu tabulai? =/ Copy paste. (Postu krāšana?) Quote Link to comment Share on other sites More sharing options...
Kaklz Posted February 5, 2011 Report Share Posted February 5, 2011 Var darīt tā, ka uz Date kolonas uzliek unikālu indeksu un izmanto INSERT INTO tabula SET date=xxx, number=Y ON DUPLICATE KEY UPDATE number=number+Y Quote Link to comment Share on other sites More sharing options...
marcis Posted February 5, 2011 Report Share Posted February 5, 2011 Kā lai dabū tādu tekstuālu atspoguļojumu tabulai? =/ Konsoles spēks Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 5, 2011 Report Share Posted February 5, 2011 Copy paste. (Postu krāšana?) Nesapratu. Tagad jautājuma paprasīšana skaitās kā postu krāšana?? Tu esi galīgi slims, ko?! Quote Link to comment 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.