Search This Blog

Saturday 14 November 2015

Get comma separated column values from database using php

<?php

$con=mysql_connect('localhost','root','');

mysql_select_db('db',$con);

$result = mysql_query("SELECT * FROM  posts");

while($rows = mysql_fetch_array($result)) {

   $title=explode(',', $rows['title']);

   foreach($title as $row) {

      echo $row."<br>";

   }

}

?>

No comments:

Post a Comment