Creating arrays

This is a discussion on Creating arrays within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, I am building an introductory level (and no doubt crude) online shopping facility for a small site. I would ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-15-2003
paulm844
 
Posts: n/a
Default Creating arrays

Hi,

I am building an introductory level (and no doubt crude) online shopping
facility for a small site. I would like to use a form (generated from a
MySQL db) that either allows the user to input a quantity for each item
(only 7 or so products so far) then submit the form and add the selected
products to an array. This array will then need to be read through a
script that will calculate the subtotal etc. I have a MySQL db with all
the relevant info in as I use this in another section of the site - I
just don't know how to write the PHP to add to the array, store the
array and then read it back!

Can anyone help?

Thanks in anticipation,

Paul Marshall
paulm844 @ netscape.net

Reply With Quote
  #2 (permalink)  
Old 09-16-2003
Rob
 
Posts: n/a
Default Re: Creating arrays


"paulm844" <paulm844@netscape.net> schreef in bericht
news:3F66414F.6030309@netscape.net...
> Hi,
>
> I am building an introductory level (and no doubt crude) online shopping
> facility for a small site. I would like to use a form (generated from a
> MySQL db) that either allows the user to input a quantity for each item
> (only 7 or so products so far) then submit the form and add the selected
> products to an array. This array will then need to be read through a
> script that will calculate the subtotal etc. I have a MySQL db with all
> the relevant info in as I use this in another section of the site - I
> just don't know how to write the PHP to add to the array, store the
> array and then read it back!
>
> Can anyone help?
>
> Thanks in anticipation,
>
> Paul Marshall
> paulm844 @ netscape.net
>


Paul,

What kind of form, with or without validation, with descriptive labels or do
you use the (usually) less descriptive field-names from the table? I can
think of many more questions when creating a HTML form and creating a Form
is basic HTML and this is not the subject of this news group. If this should
be generated by a PHP script you still need to answer a lot of these
questions first. And even if you have answers to this is I do not think you
should expect somebody to give you a full script for creating these forms.
You have to do some work on your own (their are many examples on the net,
search for it in google)

This is the same for adding items to an array, this is PHP basic!
The best way for getting help on PHP language basics is by reading a good
tutorial. You can get some tutorials from the web (or buy a book)

Storing information can be done in more then one way. Choosing the right one
will depend on your business logic and constraints. It can be stored in a
cookie, in a file, in the DB or in hidden fields in a HTML form element.
(just to name a few ;-))
All of these have their advantages and disadvantages. We can't make these
decisions for you.

It seems to me you should read some basic tutorials first before going any
further and maybe you should reevaluate your project and answer a few of
these design questions first.


Or maybe you could rephrase your questions to be more specific and PHP
related.


HTH Rob






Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:43 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0