rebuilder Posted September 20, 2010 Report Share Posted September 20, 2010 (edited) Visu laiku esmu darījis apmēram šādi $query = "select dats from tabulas where nemt='Ja'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ $rezultats = $row['dats']; echo ''. $rezultats .';';} Šādi izvada visu smuki - dats1;dats2;dats3.. utt. Bet man tagad vajadzētu to visu, kas tiek izvadīt piešķirt vienam mainīgajam, piemēram, lai $dati= "dats1;dats2;dats3.. utt." Cik saprotu jādarbojas ar masīviem (???), bet kā precīzi to panākt es nezinu... Edited September 20, 2010 by rebuilder Quote Link to comment Share on other sites More sharing options...
briedis Posted September 20, 2010 Report Share Posted September 20, 2010 (edited) SELECT GROUP_CONCAT(dats, SEPARATOR ';') as dats FROM tabulas WHERE nemt='Ja' GROUP BY nemt Edited September 20, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
rebuilder Posted September 20, 2010 Author Report Share Posted September 20, 2010 Hmm, kaut kur visu laiku iesprūstu, jo nevaru izvadīt ar php. Quote Link to comment Share on other sites More sharing options...
marcis Posted September 20, 2010 Report Share Posted September 20, 2010 Ja tu varēji izvadīt, tad vajadzētu arī varēt izdomāt kā to visu salīmēt vienā stringā. http://php.net/manual/en/language.operators.string.php Quote Link to comment Share on other sites More sharing options...
rebuilder Posted September 21, 2010 Author Report Share Posted September 21, 2010 (edited) Nu nekas cits kā mēģināt neatliks, nav bijusi īsti saskare ar šo lietu, tapēc mazliet vēl patumša bilde. Interesanti, bet pie visa vainīgs bija "SEPARATOR ';'" bez tā man visu smuki izvadīja. Bet problēma atrisināt ;) Edited September 21, 2010 by rebuilder 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.