ray Posted November 3, 2006 Report Share Posted November 3, 2006 (edited) Lieta tāda, ka man ir forma, kurā ir <select multiple...> un man vajag dabūt MySQL datubāzē tā ierakstus, tipa katrs Multiple savā tabulas rindā. Piem. <input type='text' name='kkads' value='vertiba'> <select multiple name='bla'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select> un no tā man vajag dabūt tabulu: vertiba | 1 vertiba | 2 vertiba | 3 Edited November 3, 2006 by ray Link to comment Share on other sites More sharing options...
andrisp Posted November 3, 2006 Report Share Posted November 3, 2006 bla vietā liec bla[]. pēc tam: foreach($_POST['bla'] as $val) { // Kverijs } Link to comment Share on other sites More sharing options...
ray Posted November 3, 2006 Author Report Share Posted November 3, 2006 foreach($_POST['bla'] as $val) { // Kverijs } un kāds tad tas query izskatīsies? Link to comment Share on other sites More sharing options...
andrisp Posted November 3, 2006 Report Share Posted November 3, 2006 (edited) INSERT INTO `table` (x, y) VALUES ('bla', 'ble') Tie ir pamati: - http://www.tizag.com/sqlTutorial/sqlinsert.php - http://dev.mysql.com/doc/refman/5.0/en/insert.html Edited November 3, 2006 by andrisp Link to comment Share on other sites More sharing options...
v3rb0 Posted November 3, 2006 Report Share Posted November 3, 2006 delete from tablename :) par insertiem takš ir db pamatu pamati, mysql atļauj arī šitā insertus rakstīt: insert into table set field1=1, field2=2 Link to comment Share on other sites More sharing options...
andrisp Posted November 3, 2006 Report Share Posted November 3, 2006 v3rb0, bet tas laikam nebija pēc SQL standarta. Nez, varbūt maldos. Link to comment Share on other sites More sharing options...
ray Posted November 3, 2006 Author Report Share Posted November 3, 2006 sorry, mana vaina, ka tik stulbi pajautāju :D :D Link to comment Share on other sites More sharing options...
v3rb0 Posted November 3, 2006 Report Share Posted November 3, 2006 (edited) nebija, bet strādā un man dikti patīk šitāds, tabulām ar daudz laukiem vieglāk sparast ko kur liec, un nav jāskaita, pirmais, otrais.. divdesmitotrais. tikko iedomājos var it kā salikt hašmapā fieldname1=>"value1" un ar array_keys(), array_values() panākt kaut ko līdzīgu ar standarta sql, lai nebūtu jāskaita lauki ar pirkstu. Edited November 3, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
andrisp Posted November 3, 2006 Report Share Posted November 3, 2006 (edited) Jā, sintakse jau ērta vispār :). Liels oft, bet, ray, tu gan esi melis :). No tavas lapas: Like one of the biggest skiing and snowboarding web sites we are offering to you advertising possibilities in our site. Skiroad.com will be the best chance for you to reach your best client count. More than 1 000 000 times a month people are using our site skiroad.com to find information about skiing for themselves.Bet tajā pašā laikā lapas apakšā:Visitors: # Total: 667430 # Today: 36 Edited November 3, 2006 by andrisp Link to comment Share on other sites More sharing options...
ray Posted November 3, 2006 Author Report Share Posted November 3, 2006 Liels oft, bet, ray, tu gan esi melis :). tas vairs nav aktuāli, ta ir ASP lapa un tur vairs nekas netiek darīts, esmu aizmirsis ftp paroles, tāpēc vēl neesmu izņēmis no apgrozības :/ Link to comment Share on other sites More sharing options...
Recommended Posts