Question:

How to write an sql query to print all rows in a column in a single line seperated by commas?

by  |  earlier

0 LIKES UnLike

How to write an sql query to print all rows in a column in a single line seperated by commas?

 Tags:

   Report

1 ANSWERS


  1. $query = "select `columname` from `tablename` where 1";

    $list = mysql_query($query);

    while ($lst = mysql_fetch_array($list))

    echo ($lst[0] . ", " );

    mysql_free_result($list);

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions