Darkangel Posted June 5, 2008 Report Posted June 5, 2008 (edited) Sveicinati man ira radusies problema ka es nevaru iskartot datus ka man vaig veicot mysql query. Es meginaju sadu variantu bet vins negrib tomer stradat ka vaig. $query = mysql_query("SELECT * FROM user ORDER BY SUBSTRING_INDEX(data, ' ', 4) ASC"); Dati ailite tiek glabati sadi 3 54 68 26 18 Kads man ludzu varetu pateikt ka to dabut gatavu lai normali stradatu. Paldies par atsaucibu! Edited June 5, 2008 by Darkangel
Grey_Wolf Posted June 5, 2008 Report Posted June 5, 2008 (edited) gruti pateikt ko iisti gribi panakt, bet data ieliec starp `` jo tas ir Rezervetais vards ... --- Tie tadi taa arii tiek glabati? x1 x2 x3 un nakamajaa rindaa y4 yy5 yy6 ? pareizi sapratu ? ---- un gribi sakartot peec 4 tuksuma? tb tava piemeraa peec 18 ? Edited June 5, 2008 by Grey_Wolf
Darkangel Posted June 5, 2008 Author Report Posted June 5, 2008 Nu pa puseij tu saprati data ailite visa informacija tiek glabata viena gara rinda. Un es pameginaju ielikt data `` vins tik iskartoja drusku savadak bet ne ta ka vajag
andrisp Posted June 5, 2008 Report Posted June 5, 2008 Nu pa puseij tu saprati data ailite visa informacija tiek glabata viena gara rinda. Vieglaak nebuutu, ja tu paskaidrotu preciizi, ko tev vajag nevis dotu mums hintus ? :)
Darkangel Posted June 5, 2008 Author Report Posted June 5, 2008 Man vajag iskarot no lielaka skaitla uz mazako pec 4 ailites kas atrodas ieksa data ailite. Cerams es tagad saprotami isteicos.
mounkuls Posted June 5, 2008 Report Posted June 5, 2008 Hmm.... droši nezinu, bet vai nav vienkāršāk to stringu ar explode(" ",$dati); sagrūst masīvā un paņemt secībā ar sort(); ?
andrisp Posted June 6, 2008 Report Posted June 6, 2008 Vai arii izveidot papildus kolonu, un ierakstiit tajaa jau pie ieraksta ievietoshanas/laboshanas to teksta dalju. Un peec tam kaartot peec taas kolonas.
Aleksejs Posted June 6, 2008 Report Posted June 6, 2008 Šitā: SELECT lauks1, lauks2 FROM tabula ORDER BY SUBSTRING_INDEX(data, ' ', -2) ASC Jo tas atgriezīs pēdējos 2: 11 22 33 44 55 --> 44 55
Recommended Posts