PHP + MySQL and oher question

I have two questions:
First: I want to create a sort of webshop and I want to create a MySQL database in which people can sign up/log in.
How can I create this in FlashMX + PHP + MySQL.
I want people to log in, sign up and the database should register what people bought the last time(s) they visited.

Now for my second question:
For this shop I have a section on the homepage with news.
This sections needs to display the news and have a link to the archives.
Each newsitem is an images that contains the news.
How can I make Flash loads in the news dynamicaly and let Flash detect if there is an archive (archive = more than 3 newsitems in folder) and if there is one, display it?

Thanks in advanceā€¦