Jump to content

Fixing values


TheJoey

Recommended Posts

I want to replace this fetch with fixed values

Like Book $16 dollars.

its for a shopping cart

<?php
$output[] = '<ul>';
while ($row = $result->fetch()) {
$output[] = '<li>"'.$row['title'].'" by '.$row['author'].': £'.$row['price'].'<br /><a href="cart.php?action=add&id='.$row['id'].'">Add to cart</a></li>';
}
$output[] = '</ul>';
echo join('',$output);
?>

Link to comment
https://forums.phpfreaks.com/topic/172464-fixing-values/
Share on other sites

i have them stored in a array such as.

$product =  array('Men\'s Roller Blades'=> array(
                            Price => 69.95,
                            Shipping => 0.10 //shipping as a % of price
                            ),
		'Women\'s Roller Blades'=> array(
                            Price => 63.95,
                            Shipping => 0.10 //shipping as a % of price
                            ),
            'Helmet'=> array(
                            Price => 34.99,
                            Shipping => 0.05 //shipping as a % of price
                        ),
		'Knee Pads'=> array(
                            Price => 22.99,
                            Shipping => 0.08 //shipping as a % of price
                        ),
            'Knee and Elbow Pads'=> array(
                            Price => 29.99,
                            Shipping => 0.08 //shipping as a % of price
                            ));

Link to comment
https://forums.phpfreaks.com/topic/172464-fixing-values/#findComment-909253
Share on other sites

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.