问题描述:

I am wanting to pull data from MySQL and create a string with all the data pulled in a string as 1 variable.

while($row = mysqli_fetch_array($res))

{

$x= $row['SessionValue'];

}

I know that this is miles away from what I am after but if the data pulled is: a,b,c,d (commas representing each loop) my desired output would be:

$x='<li>a</li><li>b</li><li>c</li><li>d</li>'

How would I do this?

网友答案:

Just chain it in a variable

while($row = mysqli_fetch_array($res))
{

     $x= $x."<li>".$row['SessionValue']."</li>";

}
相关阅读:
Top