I have a table in my database called “usercardsetplaycounts” that has a column called “updatedAt” that I want to get updated with a fresh timestamp every time a row is edited. When I originally set this column up, I set the default to CURRENT_TIMESTAMP. Here is what it looks like in phyMyAdmin: The updatedAt date … Continue reading MySQL: How to automatically update timestamp column in phpMyAdmin when a row is edited
MySQL
MySQL: How to copy database from web host to localhost
Let’s say you want to copy the MySQL database used on a website to a local installation of PHP/MySQL for testing. In order to do this, you will need the following: Access to the cpanel of the website that has phpMyAdmin installed An Apache server with phpMyAdmin installed locally. For this, you can use Bitnami’s … Continue reading MySQL: How to copy database from web host to localhost
MySQL: How to run multiple queries in one
Let’s say we have a couple of simple SQL queries, one of which counts the total number of job hours: select sum(Hours) as totalCount from job_details where Job_ID = 42504; and another query that sums the total number of job hours that have been completed: select sum(Hours) as completedCount from job_details where Job_ID = 42504 … Continue reading MySQL: How to run multiple queries in one
MySQL: How to install a test database and confirm the installation
Now that I have installed PHP and MySQL: How to install PHP/MySQL and confirm the installation I wanted to start using MySQL so I searched for a sample database full of data that I could install for testing. I found this “Employee Sample Database” on the dev.mysql.com website: https://dev.mysql.com/doc/employee/en/ The instructions for installation: https://dev.mysql.com/doc/employee/en/employees-installation.html led … Continue reading MySQL: How to install a test database and confirm the installation