Home > Archive > PHP Language > January 2006 > Automating RMA using PHP (& MySQL?)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Automating RMA using PHP (& MySQL?)
|
|
| Tony Carnell 2006-01-24, 6:56 pm |
| Hi all,
Can I start by saying I'm a relative newbie to PHP and MySQL, so please
be kind :-)
I work for a Mac retailer and currently on our website we have a form
where anyone with a defective product fills in their details and when we
receive the form submission we send them an email with an RMA number
which they need to attach to the product before sending it back so that
we can trace who it's come from.
We'd like to automate the process so that the user types in their
details and a unique RMA number is automatically provided to them.
The RMA numbering is very straight forward and could start at 1000 for
instance and simply increase by one each time a user correctly fills in
the form, so the first person to submit gets an RMA number of 1000, and
next gets 1001, etc.
How could this be done using PHP?
I assume it would need a database (MySQL?) to hold the RMA number and
associated details about each person's product fault and simply add a
field to the database with each submission.
Does anyone know if anyone else has already written such code (there's
no sense in reinventing the wheel!) and is there any code resource sites
that are worth looking at?
Any and all help is greatly appreciated.
Thanks,
Tony.
| |
| Danny Wong 2006-01-26, 6:57 pm |
| HI,
If you use MySQL, its very simple, create a table to store your clients
fill in form with
create table clientrequest (rma int(10) unsigned auto_increment,
........., primary key (rma))
With the about table, your php code just insert the data as
insert into clientrequest values (0, ......)
Note the first 0 in the statement, it will tell MySQL to insert the
record with next avaliable unique ID. Please refer to MySQL documentation.
Hopes this help.
Danny Wong
"Tony Carnell" <tony@fluvius.co.uk>
???????:qXsBf.197416$vl2.171083@fe2.news.blueyonder.co.uk...
> Hi all,
>
> Can I start by saying I'm a relative newbie to PHP and MySQL, so please be
> kind :-)
>
> I work for a Mac retailer and currently on our website we have a form
> where anyone with a defective product fills in their details and when we
> receive the form submission we send them an email with an RMA number which
> they need to attach to the product before sending it back so that we can
> trace who it's come from.
>
> We'd like to automate the process so that the user types in their details
> and a unique RMA number is automatically provided to them.
>
> The RMA numbering is very straight forward and could start at 1000 for
> instance and simply increase by one each time a user correctly fills in
> the form, so the first person to submit gets an RMA number of 1000, and
> next gets 1001, etc.
>
> How could this be done using PHP?
> I assume it would need a database (MySQL?) to hold the RMA number and
> associated details about each person's product fault and simply add a
> field to the database with each submission.
>
> Does anyone know if anyone else has already written such code (there's no
> sense in reinventing the wheel!) and is there any code resource sites that
> are worth looking at?
>
> Any and all help is greatly appreciated.
>
> Thanks,
> Tony.
>
|
|
|
|
|