Jump to content

Problems with echoing $store->boxes->1->cost


ryankentp

Recommended Posts

Hello,

I am making a shopping cart that automatically decides what box to ship products ordered on my website in. The code connects to a mysql database and saves all the data, but I cannot find out how to echo the data, after it has been saved.

 

I know this is the problematic code:

<?php
echo $store->boxes->1->cost;
echo $store->boxes->2->cost;
?>

 

I believe it doesn't work because of the numbers (1 and 2). If you know what I can do to fix it without even needing to look at my code, please respond. If not, reading more may help you.

 

The source of the file is located at http://www.ryanpendleton.net/store.php

The output of the file is located at http://www.ryanpendleton.net/output.php

(I would have posted the code here, but I thought there was a little to much...)

 

After looking at the output, it could tell it was returning the right thing, but I can not find out how to echo the price or size of the boxes.

 

If you need me to clarify anything, don't hesitate to ask.

 

Thanks in Advance,

Ryan Pendleton

  • 5 months later...

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.