leisure Posted May 24, 2005 Report Share Posted May 24, 2005 tabulaa rindas ar komandaam... gribu taa lai kreisajaa pusee iekjekseejot komandu (checkbox) un apakshaa izveeloties no <select> grupas nosaukumu, kur <option> veertiiba = groupID datubaazee updeitotos komandas informaacija laukaa `G_INFO` = groupID! Kaa man buutu jaaraxta, lai iekjekseejot piem 6 komandas taam visaam saglabaatos datubaazee pie `G_INFO` buutu izveeleetais groupID! kaa pie chekbox noraadiit teamID? Paldies! Link to comment Share on other sites More sharing options...
bubu Posted May 24, 2005 Report Share Posted May 24, 2005 Kas ir teamID? A nevari vienkārši visus chekbokšus nosaukt name[], tad saņemot to masīvu $name skrien visam cauri, kura values būs tie ierkasti kuri jāupdeito. Tad nu arī ņem konkrētā select izvēlēto elementa vērtību un taisi savu UPDATE. Link to comment Share on other sites More sharing options...
leisure Posted May 24, 2005 Author Report Share Posted May 24, 2005 (edited) kaa tu to domaaji? <input type="chechbox" name="name[]" value="'.teamID.'" class="assign_group"> <<< tu domaaji shaadi? Jo kaa var zinaat, ka tieshi shii komanda atkjekseeta, jo db updeito komandu peec taas ID, vai pareizi uzraxtiiju to HTML ? Edit: teamID ieguust no datubaazes... Edited May 24, 2005 by leisure Link to comment Share on other sites More sharing options...
bubu Posted May 24, 2005 Report Share Posted May 24, 2005 A priekškam tev zināt kura tieši atķeksēta: foreach($_POST['name'] as $teamID) { $kautkas = $_POST['select'.$teamID]; // tb attiecīga čekbokša select sauksies, piem, select4 $query = 'UPDATE tabule SET kautkas = "'.mysql_escape($kautkas).'" WHERE teamID = '.intval($teamID); ... } Link to comment Share on other sites More sharing options...
leisure Posted May 24, 2005 Author Report Share Posted May 24, 2005 ok, paldies par ideju, meegjinaashu saprast! Link to comment Share on other sites More sharing options...
leisure Posted May 24, 2005 Author Report Share Posted May 24, 2005 (edited) ...... izvada tabulas galvu + formu ........... while( .....) = $sql->db_Fetch() { $text .= '<tr><td><input type="checkbox" name="name[]" value="'.$teamID.'">'.$team_name.'</td></tr>'; } ....... tabulas pakalju ............. if( isset ($_POST['name']) ) { foreach($_POST['name'] as $teamID) { $var = $_POST['select'.$teamID]; // tb attiecîga èekbokða select sauksies, piem, select4 $q = "UPDATE `".$config['prefix']."teams` SET `G_ID` = '".mysql_escape($var)."' WHERE `teamID` = `".intval($teamID)."' "; if( !$sql->db_Query($q) ) { die( $site->criminal_error(mysql_error()) ); } else { $text .= $site->msg_normal(LAN_249); } } } Tu biji domaajis shaadi? Te kk nau tiirs :P nesanak... Edit: garumziimes... Edited May 24, 2005 by leisure Link to comment Share on other sites More sharing options...
bubu Posted May 24, 2005 Report Share Posted May 24, 2005 error_reporting(E_ALL); ir uzlikts? kāda kļūda metās? ko mysql_error() ko saka? Parādi kā izskatās to select combokšu izvade. Link to comment Share on other sites More sharing options...
Recommended Posts