DATABASE

With this project i mainly focused on learning actionScript 3. I feel that their are and could be problems with the wa my code is structured. I feel that the way i have stored the relations between users has its own limitations.

I stored the the id’s of all the users friends in his/her own friends column. This means that i had to use the explode funtion to seperate the string then gathering all data for each id collected.

This method is really not the best way to do this. The reason why is that when adjustments are needed to be made, like deleting a friend for instance, this ment that a lot of commands are needed to be executed. To delete a friend i had to connect to my database, gather my added friends then explode then find the required id. this would then need deleting, then the string is appended and inserted back the whole process is then done again to the other user. 

For a large website that could have millions of users this could intime lead to slow transactions.
I read the book “PHP 5 Social Networking”(book). This used a method of having a table that had columns of id, userA, userB, accepted. This uses a more complexe way of sorting and storing data by using objected orientated code. this uses objects and pointers and a whole different way of structuring code.

I made a desition to create this project more simple and get to grips with flash and actionScript. I do know there will be long term issues with the way i coded it to work.
When i started this project the problem i worried about was the speed of the functionality. I found a problem that i did before starting this project. When i wanted to just recieve just one coloumn from a table i would use,

(“SELECT * FROM table”);
This would retrieve every piece of data from the targeted table. this would not be a problem when the table is very small but will have affect on a large table.

(“SELECT column FROM table”);

this would only gather data that is needed. “Web Database Applications”(book). Reading this book also helped me to draw a database and show how each table relates to each other. Whenever i creat a large project i wil use this method of actually drawing a database. I found this really helped in creating an actually seeing the workings of the database.

JOIN QUERIES

I found when researching on databases about join queries. join queries  is a query technique that matches rows from two or more tables based on a join condition in a WHERE clause and only output the rows that meet the condition. These queries are very usefull because they limit the amount of conections that are needed. If i need the password and firstname which are in two tables i would need to make two connections. This takes more time and if the tables become very large it will take longer then one connection.

table design
While working on this project a have been reading a database applications book called "Web Database Applications"(by Hugh E. Williamy, O'Reilly) This book showed how to create the working database visually to help see how the tabels will connect and communicate with each other. I found drawing the databse helped me see and understand the workings of my database. This helped when i needed information from tables.