By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

Display MySQL table values as bulleted values

ak1dnar
Expert 100+
P: 1,584
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE `products` (
  2.   `p_id` int(11) NOT NULL,
  3.   `p_name` varchar(15) default NULL,
  4.   `p_features` varchar(100) default NULL
  5. )
  6.  
from this table I am going to fetch the records and display it.
But there is a problem i have to display Product features as Bulleted lines.

Please consider this sample value:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO `products` VALUES (1001, 'Nokia6600', 'Symbian O/S,Camera,Bluetooth,XHTML browser,Joy Stick');
  • Symbian O/S
  • Camera
  • Bluetooth
  • XHTML browser
  • Joy Stick'

Along with other products info, I want to display this features in bullets.
How can i do this.Just tell me how to make this comma separated values to Bullets.
Feb 27 '07 #1
Share this Question
Share on Google+
2 Replies


ak1dnar
Expert 100+
P: 1,584
Let me further explain it in a different way.

$var = "Symbian O/S,Camera,Bluetooth,XHTML browser";

How to Split this String Value line by line.I want display it like this.
  • Symbian O/S
  • Camera
  • Bluetooth
  • XHTML browser
Feb 28 '07 #2

ronverdonk
Expert 2.5K+
P: 4,258
See the following example of your string-to-be-converted:

[php]<?php
$var = explode(",", "Symbian O/S,Camera,Bluetooth,XHTML browser");
print '<ul><li><b>';
print implode('</b></li><li><b>',$var);
print '</b></li></ul>';
?>[/php]

Ronald :cool:
Feb 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.