Shiopping Cart Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

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

Post by patrikG »

php manual wrote:mysql_query() returns a resource identifier or FALSE if the query was not executed correctly
If a resource ID is returned by mysql_query() you have run a valid SQL statement. The resource ID is simply an identifier for your "resource" - in this case a mysql-database. You can use all of PHP4+'s bundled mysql-functions (e.g. mysql_num_rows(), mysql_fetch_array()) etc. to do whatever you require - fetch data, etc. It's all in the PHP Manual.

A general note: if you are creating an online shop: YOU MUST(!!!!) make sure that what you are doing is as secure as possible. That means you know about PHP as well as mySQL security issues (e.g. register_globals, sql injection etc. etc.).
If you plan to write your own credit card transaction script as part of this shop-system: don't unless you can honestly say that you know the ins and outs of the security issues involved. And there are plenty. You'd be dealing with other people's money and one mistake in your script can cost them - and eventually you - a lot of money, time etc.
stantheman
Forum Commoner
Posts: 38
Joined: Wed May 26, 2004 8:57 am

Post by stantheman »

I'm not actually building shopping cart for use i want to use the consept of a shopping cart for another project of mine and i feel this type of logic works better.
stantheman
Forum Commoner
Posts: 38
Joined: Wed May 26, 2004 8:57 am

Post by stantheman »

I'm still not getting anything to print out
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

please post the relevant bits of the code you're using.
stantheman
Forum Commoner
Posts: 38
Joined: Wed May 26, 2004 8:57 am

Post by stantheman »

They are one page one of the thread at the top
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

I know. I presume you have modified the code to get the db-access working. Post that code-snippet, please.
stantheman
Forum Commoner
Posts: 38
Joined: Wed May 26, 2004 8:57 am

Post by stantheman »

ok i guess i should get your opion on how i shoudl go about this. This is exactly what i'm trying to do i'm not sure if i need to use the shopping cart method or not maybe you may have some useful hints. I have the page where you can customize you home

http://www.dutchmanlanding.com/customizehome.html

on submission is does some calculations and gives you your new price with the options selected and it prints a list of the options selected

What i'm trying to do it make the list after submission a checkbox so that you can uncheck them so you can remove that option becasue maybe you relized the price is to much BHut i've been struggling trying to figure this out so that is why i thought the shopping cart method might work but maybe you may have another idea you can throw my way.
Post Reply