Simple PHP coding with flash. ie (online game)

I was wondering if anyone could tell me how to make a simple test game that demonstrates sort of a Multi player online game. For instance a simple box that moves around with the arrow keys and a person possible on the other side of the world decides to push the play button and immediately he/she has his/her own little box that that he/she uses to move around, and be able to see my box that i am using.

I know i have to use php and Msql or something like that. Can anyone give me direct info on how to do this?