In the below php code, am fetching the list of items bought from database. since its stored as comma separated values am exploding it and fetching in while loop. as an output i get ordered list of items bought..
but i want the ordered list to be displayed horizontally.
Now the output is like this:
Items Bought
- Coffee Maker
- Washing Machine
For example the output should be:
Items Bought: 1) Coffee Maker 2) Washing Machine
Please help me how can i do that by list or anything to get this kind of output.
<?
echo "<strong>Items Bought:</strong>";
echo "<ol>";
$q=mysql_query("select * from lead where id='$ID'");
$rs=mysql_fetch_object($q);
$prod_interest = $rs->interested_in;
$prod_name = explode(",", $prod_interest);
$pname='';
for($i = 0; $i < count($prod_name); $i++){
$prd_name= $prod_name[$i];
//taking the product name for the id
$productname=mysql_query("select * from product where id='$prd_name'");
while ($prow=mysql_fetch_object($productname))
{
?>
<li value="<? echo $pname=$prow->id;?>"><? echo $pname=$prow->name;?></li>
<?
}
}
echo "</ol>";
?>
I think this problem is more of an HTML issue, your LIs are probably floated and thats why you get a right to left list…
EDIT:
OH, then you want to add this style to your page:
EDIT 2: