我想创建一个用逗号分隔的整数的php字符串。字符串的值来自do {} while循环。我将如何做到这一点?从一个do/while循环创建一个值的字符串
//GRAB EC DATA
$mysql_ec_data = "SELECT `ec_c_id` FROM `e_c` WHERE `ec_id` = '$e_id'";
$query_ec_data = mysql_query($mysql_ec_data) or die(mysql_error());
$ec_data = mysql_fetch_assoc($query_ec_data);
$string = "";
do {
//There will be values looping through here that I want to add to a single string.
$string =+ $ec_data['ec_id'];
} while ($ec_data = mysql_fetch_assoc($query_ec_data));
//this is how the values from the while loop should look in the string at the end
$string = 45,52,23;
'$字符串= $ ec_data [“ec_id”]。 “,”;'?这个? –