In this weeks and last weeks workshop we were introduced to phpMyAdmin which “is a free and open source tool written in PHP intended to handle the administration of MySQL with the use of a web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions.” (en.wikipedia.org/wiki/PhpMyAdmin)
We have been introduced to MySQL before but I wanted to do a bit of background research so that I could be exactly clear on what I am using in this project.
MySQL “is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack (and other ‘AMP’ stacks). LAMP is an acronym for “Linux, Apache, MySQL, Perl/PHP/Python.”
On Tuesday we began by navigating around phpMyAdmin, we learnt that the Structure tab is where you build your table, SQL tab is where you can input SQL statements – similar to the Query tab where you insert queries. The Search tab allows you to search the entire database for a specific piece of data. Insert tab allows you to insert information into the database manually. Finally, Export and Import tabs render out and download your database.
We used Brackets and FileZilla to run the php file on the internet. Brackets is a modern text editor which allows you to design web pages. We worked in a folder called project and it contained various pages: index.php, connect.php, header.php, footer.php and normal.css.
We created out form on phpmyadmin which requires the user to input their name, description, city and gender. We then transfer and create the webpage for this form within our index.php page. We have to first connect to the phpmyadmin database using our username and passwords and then we insert some if statements. We also learnt how to make a message pop up and say “invalid gender” using an if statement. Within the index.php file we were also able to sort the database results in order from ASC and DESC user ID’s. Below is all the code which outputs this function.