Hi all,
I have a slight problem, I want to be able to list items from a column in a database
The column in the database is called Features and basically contains a list of values seperated by commas ie Stainless Steel, Fan cooler, Switchable Interior Light
Now I want to be able to display these in a list of features much like the link below
http://www.advantage-catering-equipm...deck/203496999
Here is what I have so far
<?php
require 'includes/mysql.php';
$connection = mysql_connect ($host, $user, $passwd) or die ('Error connecting to mysql'); // connection to our mysql server
mysql_select_db ($dbName) or die ('Error connecting to selected database'); //connection to our selected database
//display full product
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM tblproducts WHERE id='$id'") or die(mysql_error());
while($row=mysql_fetch_assoc($query)) {
//format the output
echo '<h1>'.$row['name'].'</h1>
<br />
<hr />
<br />
<table class="center">
<tr>
<td><img src="image.php?id='.$row['id'].'"></td>
<td align>Name:<br /> '.$row['name'].'</td>
<td align>Price:<br /> £'.$row['price'].'</td>
<td align>Features:<br /> '.$row['features'].'</td>
</tr>
</table>';
}
?>
Now currently as you can imagine this just prints out the features column all on one line, how am I able to produce a list out of the items in the features field which have been seperated by a comma.
Any help would be much appreciated!
Thanks
Akin



Reply With Quote


Bookmarks