anonīms Posted October 1, 2008 Report Share Posted October 1, 2008 (edited) $ddienas_menesis = array( '1'=>'Janvāris' , '2'=>'Februāris' , '3'=>'Marts' , '4'=>'Aprīlis' , '5'=>'Maijs' , '6'=>'Jūnijs' , '7'=>'Jūlijs' , '8'=>'Augusts' , '9'=>'Septembris' , '10'=>'Oktobris' , '11'=>'Novembris' , '12'=>'Decembris' ); <select name="vecums_menesis_labots" value="'.$row[11].'"> '; foreach($ddienas_menesis as $k=>$v) { if($row[11] == $k) {$ddienas_m = 'selected'; } echo "<option ".$ddienas_m." value='$k'>$v</option>"; }; echo ' </select> Kas varētu būt par vainu, ka nevis tikai tam $k kurš sakrīt ar $row[11], bet vēl pēdējiem pieciem parādas select? :\ Edited October 1, 2008 by anonīms Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 (edited) pec '12'=>'Decembris' nav jabut komatam Edited October 1, 2008 by Mikijs Link to comment Share on other sites More sharing options...
anonīms Posted October 1, 2008 Author Report Share Posted October 1, 2008 tāpat no augusta visi pārējie arī tiek izvadīti ar selected.. row[11] == 8. Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 ieej paste.php ieliec visu kodu lai saprot kas :/ es pat nezinu kas ir $row :/ Link to comment Share on other sites More sharing options...
anonīms Posted October 1, 2008 Author Report Share Posted October 1, 2008 $row = mysql_query("SELECT FROM lietotaji * WHERE id = '$_GET[id]'"); $row = mysql_fetch_array($row); $row ir ddienas mēnesis. (int) Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 1) ko tu selecto ? 2) vai selektetais $row[11] ir "8" ? pameigini izprintet $row un redzesi kas un ka tev ir <pre> <?=print_r($row)?> </pre> Link to comment Share on other sites More sharing options...
andrisp Posted October 1, 2008 Report Share Posted October 1, 2008 Pēc $ddienas_m izmantošanas tās ir jāiznīcina. Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 vaitad vinjs neaizvietojas no jauna ? Link to comment Share on other sites More sharing options...
andrisp Posted October 1, 2008 Report Share Posted October 1, 2008 Nu protams, ka ne. Pēc tam tas mainīgais visu laiku ir ar vērtību 'selected'. Tāpēc vajag pēc tā izmantošanas, to uzsetot tukšu. Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 a ... lol :D tiesam ^^ Link to comment Share on other sites More sharing options...
blackhalt Posted October 1, 2008 Report Share Posted October 1, 2008 $ddienas_m nav definēts (Undefined variable) $ddienas_m=''; Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 nja, vnk .htaccess php_value display_errors off Link to comment Share on other sites More sharing options...
andrisp Posted October 1, 2008 Report Share Posted October 1, 2008 Mikijs, tu esi apbrīnojams koderis! Tā vietā lai izlabotu kļūdu, tu to noslēp. Link to comment Share on other sites More sharing options...
Mikijs Posted October 1, 2008 Report Share Posted October 1, 2008 :) tas ka nedefineju mainigo (nelieku klientam :D gaidit) un zinot to ka tas nav nekas traks .. ja domaju ka varu paslept.. un tad kad vajag debugot vnk on .. =) paldies. :) Link to comment Share on other sites More sharing options...
andrisp Posted October 1, 2008 Report Share Posted October 1, 2008 Nu ja tev mainīgā definēšana aizņem tik daudz laika, ka klients pilnīgi izjūt gaidīšanu, nu tad piedod atvaino. Link to comment Share on other sites More sharing options...
Recommended Posts