How to extract comma-separated column values from database using PHP

How-to-extract-comma-separated-column-values-from-database-using-php

If your values are comma-separated then explode the field of your PHP code.

<?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;
   }
}
?>
Learn Tutorials Point
We Well organized and easy-to-understand Interactive tutorials With lots of examples of how to use Tutorials WordPress, PHP, Bootstrap, Bootstrap 4, HTML, CSS, AJAX, jQuery, Woocommerce, Post, Database, Javascript, Theme, Responsive, Templates.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact us

Fill in the form below or give us a call and we'll contact you. We endeavour to answer all enquiries within 24 hours on business days.