Jump to content
php.lv forumi

MySQL query pārveidošana


Sangsom

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...