One of the current assignments is to create a PHP website that can browser televisions, with functions for adding and removing televisions. This should be helpful for improving my abilities with MySQL databases.
While searching for useful functions, I looked into SQL injections and how to prevent them, since they pose a danger to databases. This lead me to prepared statements, which sends the queries and specified values separately. Making sure to use these when necessary will prove to be important for my own project.
One of the most difficult things to add to the assignment was the function to delete database entries. Not because of deleting the database entry itself, but the image linked to it. The images are linked to the database by a filepath, allowing for easy access to the stored image. However, I'm not entirely sure on the best method to access a single value from a single row of a database yet. I got around the issue by using the same method of pulling data used to fill out tables containing the database information, but I feel there has to be a more efficient method available.
After a short period, I got tired of having to update the navigation links in every PHP file whenever I added a new page to a website. The solution I found was to use the include PHP function to add another PHP file containing only the code used in the header. Using these kinds of templates in my own project could prove to be very helpful and efficient.
No comments:
Post a Comment