Question: In my database table there is a column named 'marks' . it contains values like 50,55,67,88,...
Now I need to read this values one by one like - first 50, then 55 and so on. How is it possible using php ? 

```
include("db_connect.php"); 
   $result = mysql_query("SELECT * FROM  students   ",$con);
   while($rows = mysql_fetch_array($result))
{
   $mark1=$rows['marks'];//what will do here
   $mark2=$rows['marks']; //should get value 55 and so on
}

```

Answer: 
If your values are comma separated then explode the field. 

<http://php.net/manual/en/function.explode.php>

```
include("db_connect.php"); 
$result = mysql_query("SELECT * FROM  students", $con);

while($rows = mysql_fetch_array($result)) {
   $mark=explode(',', $rows['marks']);//what will do here
   foreach($mark as $out) {
      echo $out;
   }
}

```
You should use the explode function

```
$marks = explode(",", $rows['marks']);
foreach($marks as $mark){
  //your code to do something with the mark.
}

```