Need Help Understanding OO-Programming

Hello guys!

I really really really hope anyone can help me because I am quite desperate about a little project I’m making.

I want to construct a sort of online catalog for books with a “shoppingcart” and a profile for every user, but object orientated.

I have a database with the table products which contains: ID, title, author, genre, price etc etc etc

My main question is: How can I get one single field from the database with e.g. a function called getPrice();

I tried everything but nothing displays the data the way i want to. I simply want to have a sql-statement in this function and when I am calling the function getPrice() later on it displays just the number and no Array, code or whatever.

Is there a way to call getPrice() and get “20.00” back? How does the sql-statement look like?

Please Help!

First, why complicate this when there are several ecommerce systems that are free that you could use rather quickly?

Yes, you can do what you want. What have you tried? could you post the code you have for that function, how it is called, ectera?

From the look of what you say in in the products table, the design is flawed from the start.

Yeah it would help to see what you are doing. Making a system like this from scratch in proper oop is a lot of work… It’s very hard to answer how the function should be written without knowing how the rest of your application works.

Sponsor our Newsletter | Privacy Policy | Terms of Service