Week 19: Cloud Computing

Introduction
When cloud computing was being planned, it's scalability was probably one of the most things that was considered. Since it was created in recent years, the internet growth was one of the things that were happening pretty fast at the time and still is. This means that cloud computing had to be developed to support a huge number of users and traffic. In this post I will discuss some features, problems & the future of cloud computing.

Features
Application Programming Interface - Cloud computing systems provide an API that enables machines to interact with these systems

Cost - Usually these type of systems don't require the users to pay a whole fee and purchase the hardware etc, instead with cloud computing most of the company's have arranged that the users pay a monthly fee( service fee)

Location independence -Allows users to access the application/system from everywhere in the world with an internet connection.

Tenancy - allows the users to share resources & costs between each other

Scalability - by providing dynamic resources through an automatic procedure.

Maintenance -is much simpler because of centralized system & applications do not need to be installed on the computer of every user.


Problems

Privacy - Some users have concerns about storing their data on a system which is not owned by them.

Open API Standards - API's that are released by these systems, are well documented but the interface is not standard throughout all the systems.

Security -Since these systems could be accessed by the public they are more vulnerable to hackers.

Availability - many companies switching to a cloud based computer system are concerned about the the system's availability meaning that they have no control over when the system is online or offline although cloud based systems have their teams to back them up.

Bandwith - Since all the data in online, users now have to download the data in order to use use it thus using more bandwith.



Cloud Computing Model


My 2 Cents
During the class discussion we discussed how companies are switching to cloud based systems for daily operations. The most popular move that companies do is to move the email systems to a cloud based system for several benefits. Many companies are really skeptic to move to a cloud based system but it's were the technology is going & most of them understand that it's a must do in order to keep up to date. My opinion on this matter is that most maintenance issues are eliminated once the switch is made since the system is them maintained by the company providing the cloud service. Because of this and other issues, costs are also lowered especially in the short run. I believe that people should switch to a cloud based system for these main reasons: 
 - Accessibility : Can Be Accessed From Everywhere
 - Costs & Maintenance : Cut costs & eliminate maintenance
 - Centralized & up-to-date data : Data is always updated upon in order to have an updated version of all the data

Also if you make a decision to switch to a cloud based system, make sure you get regular backups of your data in case the system decides to die on you.

Week 18: Social Networking


Introduction
Social Networking has been around for quite some time before the Internet even existed. This was through the form of Bulletin board systems where users used to upload/download files & share messages between each other. It has evolved a lot throughout the years & is now one of the largest markets in the world where Facebook is the top company that is making the most money over the Internet. The best thing about this? It's community based so people help it to grow without even needing adverts and marketing.

Modern Social Networks
Hi5
LinkedIn
Tumblr
Flickr
Twitter
Facebook
Google+

Social Media




Google+
I decided to write on Google plus social network for the simple reason that it is new & quite promising I must say. It is still in beta so I got an invite for a beta account in order to use it. We decided to try it all together in the classroom & I very much compare it to facebook but much more customizable& fast. For example your friends could be separated into different "circles" which are sections where you put your friends & family. For example I put all my classmates & teachers into a circle named School so I can identify & be able to only share some of the stuff with them. We also made use of the "Hangout" which is a nice feature in google+ involving video conferencing between 2 or More persons. It's fast as well since there's no flickering with the videos. I also think that their "stream" is pretty much Facebook's Wall so it's quite intuitive if you have used facebook before.

Social Media Marketing
As Facebook caught on we can see many local company's using facebook to market their products & services. For example radio stations are making use of facebook to communicate with their listeners & companies are making competitions using the Like button in order to market their company. People using facebook are loving this and seem to be enjoying this new experience. This revolution will keep on going and I think that we will see some major changes in the upcoming years which will also change how the population perceives the Internet.

Conclusion
As the web technology keeps improving day by day so do web applications. More entrepreneurs keep seeing the profit potential of the Internet and are competing with loads of small & large companies. Mark Zuckerberg showed us that with the Internet there's no limitations & at his young age he made more money with facebook than what google made. As mentioned earlier, I believe that we are going to see some major changes going on very soon and companies will need to adapt to these changes in order not to fall back and loose their market.

Week 17: Mobile Phone Web development


Introduction
With the popularity of mobile phones sky rocketing this year, we have to think for an additional platform when developing a web site. This year there was a higher amount of mobile phones sold than laptops so we can see the popularity of mobile phone browsing especially with new internet technologies in mobile phones such as 3g & wifi.

Mobile Phone vs Smartphone
Do you remember when the only mobile phones we had could only send text messages and receive/make calls. Yes they still exist but are slowly becoming extinct with more smartphones being purchased everyday. Due to the powerful features they are coming out with, I bet that they will in the future eliminate the use of a computer as well. With the applications that can be installed on the phones, one can do almost anything imaginable like managing your business, print & share documents, play games, tune your guitar & a lot more. Some of the recent smart-phones also come with a 1- 1.2Ghz cpu which is really fast for such a device. The multi-touch screen also makes every command so much simpler.

Current Brands & Platforms


IOS - Apple
This is one of the most famous platforms in the world. The iphone's design gets a lot of attention which may be one of the biggest selling points but with the IOS it works as smooth as a Lamborghini.


Microsoft - Nokia, Samsung, Motorola, LG, HTC

Being more famous in the past but started fading recently, the companies still develop mobile phones based on a Microsoft Platform. This brings a choice to the people which would like to buy a Windows Mobile Phone


Android - Samsung, Sony Ericsson, Motorola, LG, HTC
The Number 1 competitor with Apple's IOS, Android is an open source platform so it can be used by different companies all over the world not just one. Currently andriod phones are more powerful than the Iphone at the same price or slightly higher and come in an equally nice design.

Browsers
It also happens that there's a browser war going on between mobile web browsers, here's a list of mobile web browsers that are currently used by mobile phones:
Safari on Iphone
 SkyFire for Symbian, Microsoft and IOS phones
 Android Chrome Browser for Android Based Phones
 Bolt Browser for Multiple platforms but popular in Blackberry & Motorola
 Internet Explorer for Windows based phones
 Firefox Browser for Andriod phones & Iphones

Opera Browser for Blackberry,Iphones & nokia phones.





GeoLocation
Geolocation is a new feature in HTML 5 which allows the developer to use inbuilt features through javascript to access & find the visitor's geo location obviously depending on the browser support. Beneath is a list of browsers that support this HTML 5 feature.


GeoLocation Support

  • Internet Explorer 9.0+
  • Firefox 3.5+
  • Safari 5.0+
  • Chrome 5.0+
  • Opera 10.6+
  • Iphone 3.0+
  • Android 2.0+
We coded some geolocation code to see how it works & accessed it through our mobile phone to see if it supports it. What this script does is to first check wheter or not the client supports geoLocation & then get the latitude and longitude if it does work on the client. We also noticed that the browser asks for your permission before sharing your location. We also tried to access the file locally through Google Chrome browser but due to its security measures the permission was denied, instead on other browsers such as Mozilla firefox and Internet explorer let the file run freely. You can download the file by clicking here

Conclusion
As the same with all the HTML 5 features, this is quite a nifty feature that eliminate a lot of work for the programmer but the application shouldn't solely depend on it because of support issues obviously. A major disappointment in my opinion is that it asks the user for permission every time. I can understand that there may be some privacy issues but you cannot wait for a user's response when his location is critical for the application to work. There's another way you can do this by use some free API's out there to get the location via the visitor's IP address and here's a link to one of those services.

Week 16: HTML5, Javascript, CSS


Introduction
The new kids on the block are HTML 5 & CSS3 in web development which incorporates several new web features & was said to eliminate Flash elements from web pages. HTML5 is already available & even web browsers are already upgrading their technologies in order to support its features. Since not all the browsers currently support HTML5 a developer should only develop some of the elements in HTML5 or use HTML5 only for browsers which support HTML5 & use HTML4 for other browsers which don't support HTML5. The same statements apply also to CSS3.

HTML5 Features
<Figure> element - should contain an <img> tag & <figcaption> tag. the FigCaption tag should contain the caption of the image in text. The figure element allows the browser to combine the image with the caption

No more the need to use "type" with link & script tag - as the heading says, in html5 there is no more need to define the type of link or script.

ContentEditable - This nifty element property allows a visitor to edit content on the client side without the need of javascript. On an element that you need editable you should add this property: " contenteditable="true" ".

ContentEditable - This nifty element property allows a visitor to edit content on the client side without the need of javascript. On an element that you need editable you should add this property:

Email,Telephone,Search Inputs - Input field types that have been added include email, telephone & search inputs so that there is no need to validate with javascript & the form will expect the mentioned input type.

PlaceHolders - Inputs also have a placeholder property that will allow you to set a sort of default value & when the input is focused it is cleared. The reason for placeholders is to help the user with what he should input.

<Header> & <Footer> Elements - No more using divs with Id's to identify sections in the web page. These tags can be used to encapsulate all the content you want to put in.

Require Attribute -  Form elements can also have a required attribute to imply that the field is required by the in-putter.

AutoFocus - Form fields can now have this attribute so that they focus immediately as the page loads without the need for javascript.

Audio Support - There's no more the need for third party plugins in order to incorporate audio files in web pages, with the<audio> tag you can include audio files.

Video Support - As with Audio support, to insert video in your web page, you just need to use an <src> tag inside a <video> tag which allows your web page to show a video without the need of javascript or Flash.

Video Preload -  When defining preload on a video tag, the video is first loaded & then played eliminated the buffer. It just loads and plays.

Input Regex -  You can define a regex in a pattern property so that the form can validate the input by itself.

Canvas Element -  The canvas element allows the developer to setup a place where visitors can dynamically create or edit 2D & 3D graphics. 
Some web apps that use canvas & Html5 are:



CSS3 Features

  • Border-radius - Allows the designer to create rounded corners on html elements using only Css.
  • Border-Image - Accepts a link to an image which is used as background for the border.
  • Box-shadow - Implements a shadow on an HTML element
  • Multiple backgrounds - As the heading describes, Using CSS3 a web page can have multiple backgrounds not just one.
  • Text-shadow - Implements a shadow on text.
  • Attribute Selectors - Can be used to select elements with all types of attributes ex. div['type' = 'hello']
  • :nth-child() and :nth-of-type() pseudo selectors - Can directly select a child by a number or a type by a number. The number is the sequence of occurrence of that particular tag.


Browser Support
Safari 4(Win) Firefox 3.5(Win) Google Chrome(Win) Opera 10 (Win) Internet Explorer 6, 7 & 8
@font-face Yes Yes No Yes Yes
HTML5 Audio Yes Yes Yes No No
Hsla() Yes Yes Yes Yes No
box-shadow Yes Yes Yes No No
Css Animations Yes No Yes No No
Css Reflections Yes No Yes No No
Css Transitions Yes No Yes No No
Canvas Yes Yes Yes Yes No
HTML 5 Video Yes Yes Yes No No
border-image Yes Yes Yes No No
Multiple Backgrounds Yes No Yes No No
Css Columns Yes Yes Yes No No
Css 2D Transforms Yes Yes Yes No No
GeoLocation API No Yes No No No
Canvas Text Yes Yes Yes No No
rgba() Yes Yes Yes Yes No
border-radius Yes Yes Yes No No
opacity Yes Yes Yes Yes No
Css Gradients Yes No Yes No No
Css 3D Transforms Yes No Yes No No


Conclusion
After using it, I conclude that HTML5 & CSS3 facilitates the life of the web developer since it eliminates all the boring & repetitive stuff that has to be coded over & over again. That said, I wouldn't recommend to develop a Fully equipped HTML5 website because not all browsers support the features of HTML5 & CSS3 and this could lead to reduced market share for your website. 

Week 15: More Second Life

Introduction
This week will be the last lesson that we'll be covering this topic since we commonly decided that it's best to focus on other subjects during the last sessions for this semester. We are still to create the objects necessary for the second life coursework though. We also experimented a little bit more with scripting on objects while cruising from one place to another

Skype Connection
One of our classmates was in Costa Rica during this lesson so he decided to join the class using skype video conversation to follow parts of the class. I must say that it was quite a pleasant experience and although we experienced some 2 second lag it worked perfectly altogether. The only problem was that due to the laptop being connected to skype was on the teacher's desk so Kurt couldn't hear us clearly.

Topic Decision
As already mentioned in the introduction, we decided to cover some new topics in the upcoming lessons which are outlined in this list:
1. HTML5, Javascript, CSS
2. Mobile web development
3. Facebook development
4. Custom PHP libraries
5. Cloud Computing
6. Web Security


Conclusion
The upcoming sessions will be pretty interesting since we will cover some new technology & will help us learn them & hopefully impliment something useful with the knowledge. The topics that I'm most interested in are Mobile web development and Facebook development because I always wanted to find some time to cover up these topics but never found enough time to do so.

Week 14 : Second Life Scripting

Introduction
Scripting makes a big part of Second Life because object interactivity is largely customizable using the scripting language in Second Life (LSL). This scripting language is similar to javascript & is event driven.

Scripting
Being  a bit more experienced from the previous sessions, I knew what I had to do in order to create scripts on objects. So as soon as I logged In I started experimenting with different script on my objects. The first thing script I wrote was executed as soon as someone touches the object. Here's the code to do that:

default
{

    touch_start(integer total_number) {

        // speak out loud!
        llShout(0,"Hello!");

    }

}
To script some code on an object, you have to right click on an object, press edit & content> new script. Than a window will appear in which you can right your favorite scripts. Here's a screen shot to illustrate just that.



Conclusion
It's pretty easy to script an object once you learn the events, internal functions and get used to the scripting language. I have already used event driven languages such as C# but i think that this language is more similar to Flash actionscript & in fact I think the two have really close similarities.This scripting language also consists of pretty good documentation which can be found online at http://wiki.secondlife.com/wiki/LSL_Portal. The conclude this post, I suggest that before trying to develop some scripts by yourself, first go into the portal & see some example scripts which you could easily understand unless they are comprised of complex graphics & 3d scripts.

Week 13 : Second Life Objects

Introduction
During the second session on Second life, we decided to go into second life during our class & meet up together to experiment with it. After adding ourselves as friends we wondered around for a bit to explore some places & decided to meet up in one place.

Creating Objects & Scripting
We made sure that we were logged in as advanced users & started creating some objects using the tools provided in the viewer. Creating an object is quite simple but it takes a little bit more knowledge to develop a script and bind it to an object.
Step 1: Right click > Build
Step 2: Draw the object in the viewer
Step 3: Name the object and set some custom properties

Afterwords you can attach a script to the object which is usually an action triggered by an event such as when someone sits on your object. I've noticed that permissions can be given to other second life members to edit the object as well, so an object can also be developed as part of a project made of multiple people. Finally once the object is ready you can wear it, use it or even sell it for linden dollars.
Scripts

//This script shows a url to the avatar that touches the particular objects

default
{

touch_start(integer total_number) {

// load a dialog with a URL
llLoadURL(llDetectedKey(0), "Tripchamp", "http://www.tripchamp.com");

}

}








//This script plays a sound every 30 seconds


default
{

state_entry() {
llSetTimerEvent(30);
}
timer() {

llPlaySound(llGetInventoryName(INVENTORY_SOUND,0),1);

}

}









//This script plays a sound every 30 seconds


default
{
string email_address = "xx@example.com";
touch_start() {
llEmail( email_address, "Hello World Email!", "This is a test email");
}


}
Experience
As already mentioned, during our session we decided to meet up all together in second life with our avatars. It was a funny experience since we watched as some so called second life geeks threw some objects at us and called us noobs while we were trying to repell back without any success. We created objects near each other, interacted with each other aswell as with each other's created objects. We also noticed that the viewer has a music player integrated with it which plays quite some nice music. Finally we decided to meet up in Middlesex(On second life obviously) & took a picture which you can view underneath. 

Conclusion
Today was all about meeting each other, becoming friends on Second Life, Experiencing the World, creating objects & taking photos. One thing I'm starting to admire about this 3D world is it's vast flexibility in allowing users build it piece by piece. We can take an example with facebook which is the world's most profitable user driven website & we can say without it's users it's just a useless piece of software with no revenue. Comparing to such software, up till now Second life hasn't made similar success but may one day in the future.


Week 12: Second Life

Introduction
Second Life is a place where people meet & interact virtually through a virtual world. It's not specifically a game & there are no objectives one can tick off. Just imagine our world but transformed into a virtual world where you can control your avatar commanding it to do whatever you like, sort of like in the movie Avatar. Developers can create new objects and even sell them for a hefty price should they want to. These objects can be used by all avatars and consist of all imaginable things such as clothes, tables & much.... much more.

My Experience
Although I used to play some computer games in my early years, I grew out of them & it's now to me just a waste of time. That said, this is school work so it must be done, so I embarked into the journey of exploring this virtual world with my ugly looking avatar. The first thing I noticed is that the virtual world objects are painfully slow to load & this is because all the objects are downloaded from their server in real time. As a "Player" you only have a client/viewer which connects to Second Life's server and displays all the objects giving you the ability to control your avatar. In my opinion it's still not developed to the extent were people will actually enjoy their time on Second Life. I imagine a future where websites like ebay & facebook will be integrated with this sort of virtual 3D world were real people could interact with other people or buy real world items through a virtual world interface. People would probably enjoy something like that since they will be actually managing  their own real life through a 3D virtual world. Lately many movies have revolved around this idea such as the blockbuster Avatar & Surrogates starring Bruce Willis & It's probably an inevitable future and we will one day end up with something similar.


Features
When you first open your viewer you'll notice that before you login you can choose between a "basic" user type or an "advanced" user type. As a basic user, you are only allowed to participate in the virtual world by moving around, interacting with objects & socializing. On the other hand, advanced users can go into the world and create objects which in the future can be used by several other users who wish to make use of created objects. You can definitely see a difference in the interface when logging in the advanced mode since tools to create objects are added.

Conclusion
Quite different than any subject I've learned in my previous courses & in my honest opinion it's not an important one since I rarely ever seen a company making use of this type of world in it's operations. Maybe you are thinking to yourself that in the future it may come useful, well who knows maybe it will & maybe it won't but I'm almost 100% sure that if in the future anyone is interested in something like this a new platform will be developed.


Week11: Coursework 2

Introduction
After following some PHP lessons, the coursework's time was up. The task consisted of a simple web based file manager coded with PHP,MySql, HTML,CSS & javascript which concludes the subjects we've been learning for the past 10 weeks. The program allows users with an account to login, upload/delete files, Create & delete new directories & move through these directories while they comply to a space limit. This is the quota every user has on the hard disk.

Development
Firstly I created a simple database with one table, which will store any user that registers in order to use the web based application. Once that was ready, the actual application started to be developed. Now there's 3 simple pages that this system needed,
  1. Login - User logs in the system
  2. Application Page(index) - User uses the system
  3. Register Page - user registers to use the system
  4.  
    For easier database access a database class was created which helps with the connection/disconnection of the database itself & other necessary queries. For other important functions there was not enough time to develop a well structured class that does all the dirty work. So if you happen to open the index.php(Main Application page) page you'll notice that everything is mashed up together and the code is not so readable. At a later stage this could be fixed by putting all the necessary functions in a separate class and use the index.php only to combine everything with each other.

    The main features that have been developed are:
    1. Login/Register/Logout
    2. Upload/Download Files
    3. Quota / Disk limit of 50mb
    4. Creation of new folders
    5. Deletion of folders & files
    6. Design using css
    These tasks where rather simple to impliment & were completed without any problems(sort of). There was only one of these features which resulted problematic.
    I’m talking about the deletion of folders & files. I used the unlink() function to remove files & the rmdir() function to remove the directories. I thought I got everything working but after some testing I noticed that the deletion of folders which included other files wouldn’t work because recursive deletion is not a function of rmdir(). So I set myself to research some examples of functions which could be used to recursively delete a folder. Here’s the function I came up with:

    //Actual Function
    function remove_directory($dirname) {
    if (is_dir($dirname))
    $dir_handle = opendir($dirname);
    if (!$dir_handle)
    return false;
    while($file = readdir($dir_handle)) {
    if ($file != "." && $file != "..") {
    if (!is_dir($dirname."/".$file))
    unlink($dirname."/".$file);
    else
    remove_directory($dirname.'/'.$file);
    }
    }
    closedir($dir_handle);
    rmdir($dirname);
    return true;
    }


    //Example Usage
    remove_directory($path);

    Special Features
    After implementing the main tasks I researched some of the popular file managers for cool features that I could implement as special features. One that got my eye was the dragging & dropping of files & folders into other directories in order to move these elements. I already knew that the popular javascript framework Jquery had some UI elements (mainly the draggable & droppable) which could make this possible.

    So after downloading the Jquery Libraries I implemented this using javascript which can be found in the index.php file.
    Basically the Jquery libraries allow you to set a source which can be dragged and a container which can hold a dropped element. After that, you can also retrieve the properties of these elements which is where there ID comes into place. In the html markup an ID on each row was setup & the directory of the file or folder was set. So when a row is dragged onto a folder I know which file wants to be moved in which directory right?

    Now here’s where the magic happens, Ajax is a powerful way to transfer data between the client & the server without refreshing the page. So what I did was to pass the source file & the destination folder as a variable to move.php through AJAX which will in turn simply move the source file in the destination folder using php’s rename() function.



    Another Feature which I tried to implement was a multiple file uploader. The native html file chooser does not support this kind of function so I researched some Jquery libraries that could make this possible. After about a half an hour of research I stumbled upon one of the best plugins which comes with a cool name as well - Uploadify. It’s rather easy to implement but as soon as the testing started one particular problem came up. I could not find any way to check the file sizes that were being uploaded (In order to restrict to the user’s file disk quota) through javascript & didn’t have the time to research much into it either so I decided to abandon it altogether. Other than that one problem , it did work flawlessly and it also comes with quite a nice user interface by default.

    Future Improvement
    This application is just a core basic to its potential. It can be furthur developed into a much more sophisticated & secure file manager where more features can be included. Here are some features on the top of my mind that could be developed:

    1. Rename Files & Folders
    2. Check for files/folders with same name before moving/creating/uploading.
    3. Better User Interface & prompts
    4. Account section where users can modify there account information
    5. Undelete files
    6. Share folders
    7. Download Whole Folders
    8. Mobile support

    Conclusion
    That’s all I have to say for this post, here are a few screenshots of the application & the source files. See you next time!

        1. Login Page

       
     
        2. The main page after logging in. On the left under the logo we can see the quota & a logout   link. On the right hand side all the folders & files are listed together with the upload & create directory sections.


        3.  Navigating in  a Sub Folder, We can see the Up - Directory button on top.


        4.  Dragging a file into a folder in order to move it into that directory.



    Finally heres a link to download the source files.


    Week10: Mobile Techbologies


    Introduction
    In the world of today, technology gets old pretty quickly & this is also the fact with mobiles & mobile technology. When you buy a new mobile phone it seems like it gets old within 2 months because the improvements are so frequent.


    Technology Improvement
    Mobiles have come a long way especially in these last couple of years. Screens got bigger, Battery life got longer, CPU speed has gone faster & many more. Here's a list of new mobile technologies:
    •      Longer Battery life
    •      Better Communication
    •      Better & Bigger Screens
    •      Faster CPU speed
    •      Better antennas
    •      GPS
    •      Compass
    •      Touch screens
    •      Higher RAM Storage
    •      Better Operating Systems
    •      Apps
    •      Higher Storage
    •      Easier user input through touch screens

    Service Improvement
    In order to keep up with technology, even mobile service providers had to improve their services. We can recall to about 9 years ago where the internet didn't exists on your mobile, 7 years it did exist but it was excruciatingly slow which brings us to today where the internet connection on your mobile compares to that on your pc. With the improvements that will come during the next years, we will probably see a huge improvement on internet connectivity on the mobile phone.

    Here's a couple of service technologies which evolved during the years:
    • GPRS - Packet oriented mobile data technology
    • EGPRS - Extended on above
    • Edge - same as EGPRS
    • 2g - Transformed the connected from analog to digital
    • 3g - Data transfer can accommodate TV, internet & video calls.
    • 4g - Mesh Network, can reach upto 100mb/s data transfer speed.



    Security
    With new technology always coming up, there is an issue with security. We have recently heard on the news that Apple has been tracking the locations of every iphone user and sending those locations back to Apple.

    Lab Work
    This week, we were assigned to acces this blog through a phone browser. Since I do not currently have a web-enabled phone, I decided to use an emulator which can be accessed at: http://www.opera.com/mobile/demo/


    Here's a screenshot of the result:


    Given this image, this blog shows that it is not optimized for mobile web browsers. Still it was pretty easy to navigate through the webpage because the elements are not compressed altogether. A simple solution would be that of Only showing the posts in a narrower width when a mobile browser is detected and eliminate all the other widgets & extra elements.

    Week 9 : Relational Databases


    Introduction
    Following up on the previous week's post, here is some more advanced php stuff to learn from. In this post we will cover forms, session, cookies, useful variables & more.

    MySQL
    MySQL is an open source DBMS which is widely used in php applications for its various advantages. PHP comes with in-built functions to use a mysql connection which is both fast & reliant. Here are some of MySql commands which one has to use in order to Retrieve, Manipulate and Delete data in a MySql Table.

    Insert
    Inserts a new row into a specified value with specified values
    Example:
    INSERT INTO table_name (column1,column2,column3) VALUES (value1,value2,value3);

    Select / From
    Retrieves data from a table in the database.
    Example:
    SELECT * FROM table_name; //Retrieves all the columns from a table
    SELECT col1,col2,col3 FROM table_name; //Retrieves the specified columns from the table.
    Delete
    Deletes data from a table in the database.
    Example:
    DELETE FROM table_name; //Deletes all the columns from a tableSELECT col1,col2,col3 DELETE FROM table_name WHERE col1= val; //Deletes all rows where the column is equals to val(can use other WHERE statements aswell)
    Drop Table
    Removes a table from the database.
    Example:
    DROP  TABLE table_name; //Deletes all the columns from a tableSELECT col1,col2,col3 DELETE DROP TABLE table_name WHERE col1= val; //Deletes all rows where the column is equals to val(can use other WHERE statements aswell)
    Create Table
    Creates a new table in the database.
    Example:
    CREATE TABLE table_name (
    id NOT NULL AUTO_INCRIMENT PRIMARY KEY,
    col_name VARCHAR(50) NOT NULL
    )
    Order By

    Orders a resultset by  the specified column & parameters
    Example:
    SELECT * FROM table_name ORDER BY col_name DESC;
    Where

    Used to filter a resultset, similar to an if statement
    Example:
    SELECT * FROM table_name WHERE col_name > 10;
    Like
    Is used to filter a resultset, similar to an if statement. It is mostly used to search for particular values in a column. This can be done by using the % operators with the LIKE keyword.
    Example:
    SELECT * FROM table_name WHERE col_name  LIKE '%search_string%';

    Connecting to a MySql Server using PHP
    Step1: 
    The first thing that we should do in order to use a MySql Database is to connect to the server where the database is connected. In order to do this in PHP, we have to make us of the mysql_connect() functions which is presented as an example below.
    mysql_connect("localhost","username","password");



    Step2:
    Since a Database server can contain more than one database/schema, we need to specify which database/schema we are going to be using. We do this by calling the mysql_select_d() function. Here's an example.
    mysql_select_db("database_name");



    Step3:
    It's time to actually send a command to the MySql database and start having fun with the data. We can send all sort of mysql queries using the mysql_query() command. This command returns a result which contains, if any, the data requested. Follow the example below in order to send a query to the server.
    $resultset = mysql_query("SELECT * FROM table_name")



    Step4:
    The next step is to check whether the query returned any results. To do this use mysql_num_rows() function like the example below:
    $count = mysql_num_rows($resultset);



    Step5: 
    Now that we have the resultset & we know that it has results, we need to iterate each result in order to do our logic. We can do this by using mysql_fetch_array() which gives us an array filled with the resulted rows as arrays or else using mysql_fetch_object() which turns the resultset into an object. 

    while($row = mysql_fetch_array($resultset)){
    //do something with $row
    }

    // while($row = mysql_fetch_object($resultset){
    //Do something with $row
    }