PLease clarify statement

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rfigley
Forum Commoner
Posts: 70
Joined: Sun Apr 21, 2002 7:10 pm

PLease clarify statement

Post by rfigley »

I'm working with OScommerce a lot and There are a lot of statements like this:

<?php echo $order->info['payment_method']; ?>

Can someone clarify what this is doing, I believe it is accessing the data from the 'payment_method' field in the "order" table of the database?

If so, not sure how to interpret a similar statement.

<?php echo $order->customer['telephone']; ?>

Thanks for any assistance.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

This has nothing to do with accessing data in a database:

$order is an object:

$order->

and customer is a property of that object:

$order->customer

Customer happens to be an associative array, hence you have

$order->customer['payment_method']

If in doubt or question use the great manual to read up on objects and associative arrays.
Post Reply