Jump to content

Trying to display my products pulled from db in ordered lists


deansaddigh

Recommended Posts

OK so firstly heres the picture so you can see what it looks like.

 

Screenprint.jpg

 

obvioulsy i want them next to each other with the name above the image and the price underneath the image. for each product.

 

Heres my code

 

<?php echo'<ol>'?>
					<!-- Make the product name clickable and pass through its id -->
					<?php echo '<li class="newproducts"><a href="product_details.php?productid='.$productid.'">' .$productname.'</a></li>';?>

					<?php echo '<li class="newproducts">' .$row ['ProductPrice'].'</li>';?>

                        <?php echo '<li class="newproducts"><a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/></li>';?>

					<?php '</li>'?>
					<?php '</ol>'?>

 

And here is my css

 

.newproducts
{
float:left;
}

 

Any help would be fantastic

Firstly thanks very much for helping me.

 

How would i put the following code in on <li>

 

<?php echo'<ol>'?>
					<!-- Make the product name clickable and pass through its id -->
					<?php echo '<li class="newproducts"><a href="product_details.php?productid='.$productid.'">' .$productname.'</a><<br />';?>

                        <?php echo '<li class="newproducts"><a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/></li><br /><br />';?>

					<?php echo '<li class="newproducts">' .$row ['ProductPrice'].'</li><br />';?>

					<?php '</li>'?>
					<?php '</ol>'?>

 

Could you possible write it for me if its not to much trouble

i havent tested this, mainly because i cant but also because i beleive you could figure out simple errors yourself, looking at the code you posted that should produce parse errors but what the hey.

 

<ol>
    <!-- Make the product name clickable and pass through its id -->
    <li class="newproducts">
        <a href="product_details.php?productid="<?php echo($productid); ?>"><?php echo($productname); ?></a><br>
        <a href="<?php echo($file); ?>" target="_blank"rel="lightbox"><img src="<?php echo($file); ?>" width="100" height="100"/></a><br>
        <?php echo($row ['ProductPrice']); ?>
    </li>
</ol>

 

p.s. I edited it a few times, try that but you cant just come and ask every single time one little thing doesnt work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.