Jump to content

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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.