Hey, i'm fairly beginner to php, but i'm pretty good at flash scripting...

Basically, i've created a shop in flash, and it all works fine, creating invoices with php by sending all the variables to the php file.

What i'd like some help on is a php script to store all the invoice details in a my_sql database... Here's the variables i'd like to store

Order Number
Name
order0 ---
order1 | - this is an array, each number contains the
order2 | details for each item purchased
order3 ---
address
phone number
e-mail address

In the long run i'd like to be able to search the database, and bring up old orders, by just typing in the order number.

The flash file generates a random number as the order number, e.g. 1233-32423-4234234, now the chances of the same number coming up twice are about 1 in 10000000000000000 or something, but i'd like the flash file to check if the number has already been used (by searching the database) and if it has, generate a new one.

I don't know if any of this is possible, but i'm pretty sure it will be...

If anyone could help with any part of it, that would be greatly appreciated

Thanks