OpenLampTech issue #22
MySQL workbench; WordPress security; WordPress block themes; Pivoting with MySQL; Laravel eloquent queries; Concurrency explained; Useful MySQL tweet
Hey glad to have you here! 👍
If someone shared this newsletter with you and you are not yet subscribed, please use the Subscribe button below and join:
Receive a free copy of my eBook, “10 MySQL Tips For Everyone” when you subscribe to the weekly OpenLampTech newsletter!
Recently from the Digital Owl’s Prose Blog and OpenLampTech Publication
This week over on the Digital Owl's Prose developer blog, I published a handy article on creating a MySQL table using the built-in components in MySQL Workbench without the need to type any MySQL code. Check out the post, MySQL Workbench GUI - Create Table, and learn how.
In the OpenLampTech publication, I really dropped the hammer with an in-depth article on my initial exploration, learning, and use of the MySQL
GROUP BY WITH ROLLUP modifier. Be sure and read the post, Multi-level Aggregation Using MySQL GROUP BY WITH ROLLUP. I have plans for a 2nd follow-up article to this one in the future.
A Message From This Week's Sponsor
This week's OpenLampTech newsletter sponsor is, me!
Help support this newsletter and my content by visiting the sponsor below. Thank you! 🙏
Join the "MySQL Learning Tier" membership over in my Kofi Shop for exclusive premium content in the form of:
Blog posts unpublished elsewhere
Instructional and learning video shorts.
I have curated some fantastic reads for you this week. Let’s get to them!
This Week’s Picks
✔️ MySQL Pivot: How To Generate a Pivot Table
By: Ben Brumm
These types of queries that are outside of the standard CRUD are my absolute favorite. I use
PIVOT functionality quite often in my day job for reshaping query results.
Ben Brumm at the Database Star Website/Academy has some of the best SQL content on the internet and this article is one such example of the quality resources the site publishes.
In this post, you learn what PIVOTing data is and how to reproduce those concepts in MySQL. Some SQL flavors have dedicated pivoting functions built right in.
However, MySQL does not (at the current time of writing). But, there are workarounds and means to obtain this type of query results leveraging available functionality in MySQL.
✔️ 5 ways to optimize your eloquent queries
By: Cosme Escobedo
#php #laravel #sql
Although this article covers Laravel Eloquent query optimization, these tip concepts should be considered for most any ORM or Database interaction.
A couple of the tips I really appreciate are:
Select only those columns you need.
Don't retrieve unnecessary rows.
Both of which are what I consider, standard or staple practices in the SQL database world.
✔️ Using 'query()' in Laravel Eloquent Queries
By: Ashley Allen
#php #laravel #mysql
This article is a follow-up to a Twitter poll the author ran and received valuable information on concerning a preferred Laravel Eloquent query method.
I do not have any experience with Laravel or Eloquent but, this situation is pretty common in SQL as there tend to be multiple ways you can retrieve a set of data. Many times in the SQL environment, the choice of which to use is often dictated by performance.
The author covers a comparison between these 2 methods with informative insights into each.
A great read for curious Laravel developers.
✔️ Difference between if, switch statements and match expression in PHP
By: Sehouli Hamza
This blog post covers some subtle but important differences between the
switch statements in PHP. One of which I was not fully aware of in regards to strict and loose comparison with each statement.
We also learn about the newer match expression which I currently haven't used any up to this point.
Great overview of all 3 of these conditional constructs.
✔️ WordPress Security: 10 Tips To Secure Your Site In 2022
By: InkBot Design
I think it's safe to say that WordPress is here to stay. As great as that is, it puts a massive target on the CMS for security bugs and breaches.
This post covers 10 practices you can implement to better harden your WordPress site along with 10 measures you can take if your site is compromised.
I have no idea where to start really learning WordPress development. However, articles like this provide an understanding of the importance of WordPress security.
✔️ MYSQL SINGLE QUOTES IN STRINGS
By: SHAFI SHAIK
This short blog post reminds us that we should be mindful in dealing with text data that have single quotes or apostrophes in them. In order to escape the single quotes, simply preceded that quote or apostrophe with an additional quote.
We see a couple of simple queries to demonstrate such.
✔️ A Deep Introduction to WordPress Block Themes
By: Ganesh Dahal
I won't even pretend to be able to summarize this lengthy, detailed article. I'm actually glad I found it.
It seems like there are more loose ends in learning WordPress than in any other ecosystem (at least that's my feeling). But, this article lays out a lot of the basics of block themes in general.
Lots to learn and lots to read in this one.
Save it for later. I am.
✔️ Concurrency Control — The Heart Of Transactions
By: Ani Goswami
This article may be the most technical, yet, well explained out of any I've read about transactions and concurrency.
A high-level overview of each of the ACID properties is covered along with details on the differences between optimistic and pessimistic locking.
Full of great information.
Helpful MySQL-related Tweet
Support OpenLampTech, my blog, and my work with a coffee if you would like.☕
You Should Use This to Visualize SQL Joins Instead of Venn Diagrams
Newsletter Shout Out 📣
The WP Minute (I’m really enjoying this one)
Did you enjoy this issue of OpenLampTech? Please share it with others so that they can enjoy the content as well. Thank you!!!
Thank you for reading. I hope you have a great rest of your week.
Visit my blog Digital Owl’s Prose, where I write regularly on CodeIgniter, PHP, and SQL. I’m also active on Medium, LinkedIn, Twitter, and Instagram.
Want to support this newsletter and my work? Drop some spare change in my Tip Jar.💰
Disclosure: Some of the services and products links in this email are affiliate links. At no additional cost to you, should you make a purchase by clicking through one of them, I will receive a commission.