Sangsom Posted October 6, 2011 Report Share Posted October 6, 2011 Sveiki visiem, gribētu palūgt palīdzību.. Tātad ir MySQL pieprasījums: $query = mysql_query("SELECT category_id FROM users_to_categories WHERE user_id = 18 ORDER BY category_id"); while ($row = mysql_fetch_array($query, MYSQL_NUM)){ echo $row[0]; } Pieprasījums teiksim šajā gadījumā atgriež 3 category_id uztaisot echo izvadās šie 3 category_id kopā... Šādi: 1810 Taču man viņus vajadzētu iegūt galu galā šādus : 1,8,10 Kādas rekomendācijas kā to panākt? Quote Link to comment Share on other sites More sharing options...
briedis Posted October 6, 2011 Report Share Posted October 6, 2011 ojjjj $query = mysql_query("SELECT category_id FROM users_to_categories WHERE user_id = 18 ORDER BY category_id"); $res = array(); while ($row = mysql_fetch_array($query, MYSQL_NUM)){ $res[] = $row[0]; } echo implode(", ", $res); Quote Link to comment Share on other sites More sharing options...
Sangsom Posted October 6, 2011 Author Report Share Posted October 6, 2011 Ļoti jauki, paldies par ātru atbildi :) 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.