In mySQL I have saved in a column seasons
the row Autumn, Spring
However on the fronted I have to convert it to
'Autumn', 'Summer'
as below
$('.seed_season').selectpicker('val', ['Autumn', 'Summer']);
How can I achieve this?
In mySQL I have saved in a column seasons
the row Autumn, Spring
However on the fronted I have to convert it to
'Autumn', 'Summer'
as below
$('.seed_season').selectpicker('val', ['Autumn', 'Summer']);
How can I achieve this?
Assuming you are getting the row value by using PHP / MYSQL
than you can use like that:
$DBvalue = 'Autumn,Spring';
$exploded = explode(",", $DBvalue);
$newString = "'".implode("','", $exploded)."'";
echo $newString; // 'Autumn','Spring'