php Parsing From Stored Mysql comma seprated Data
like
id subject
1 science,maths
2 maths,english,science
3 history,maths
i want to display
science
maths
english
history
can u help me
php Parsing From Stored Mysql comma seprated Data
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: php Parsing From Stored Mysql comma seprated Data
And array_unique():
Code: Select all
$result = array();
foreach ($row as $val) {
$result = array_merge($result, explode(',', $val));
}
$result = array_unique($result);mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.