OpenLampTech

Share this post

OpenLampTech issue #20

openlamptech.substack.com

OpenLampTech issue #20

Sanitizing input in PHP; MySQL SQL_MODE; Handy MySQL information queries; Strings to dates in PHP; PHP access modifiers; Finding a WordPress backdoor

Joshua Otwell
Apr 1, 2022
Share this post

OpenLampTech issue #20

openlamptech.substack.com

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 on the Digital Owl's Prose developer blog I covered a handy way to use the ALTER TABLE command and add multiple columns to an existing table in one command. Read, MySQL ALTER TABLE - Add Multiple Columns, for more information.

In the OpenLampTech publication this week I published an article covering the MySQL SUBSTRING() character function.

OpenLampTech
MySQL SUBSTRING() Function - With Examples
String and text data are so common and integral in today's data landscape that programming languages provide a full suite of functions, features, and constructs out of the box to help process this type of data. Many times, there are only certain parts of a string or text value you need to parse, inspect, or work with…
Read more
a year ago · 1 like · Joshua Otwell

I have curated some fantastic reads for you this week. Let’s get to them!

This Week’s Picks

✔️ Sanitize Input using PHP

By: codeanddeploy

#php

Anytime we are storing user-provided information in the database, we should definitely sanitize it and protect the data store as much as possible.

In this post, we see a great example function that filters input data using the built-in PHP htmlentities() function.

➡️ Read this post…

✔️ Handy MySQL Information Queries

By: SHAFI SHAIK

#mysql

Here are 4 short articles covering queries against various tables in the MySQL INFORMATION_SCHEMA database that you can use and retrieve super-useful information from.

I've really started to learn more about - and use - the INFORMATION_SCHEMA database as I focus on building MySQL skills.

  • SEARCH FOR A SPECIFIC COLUMN IN VIEWS – MYSQL

  • SEARCH IF A SPECIFIC COLUMN IS USED IN STORED PROCEDURE OR FUNCTIONS – MYSQL

  • NUMBER OF VIEWS AND TABLES IN EACH DATABASE – MYSQL

  • TABLE LAST MODIFIED DATE – MYSQL


🔒 I've published a paywalled article over on my Kofi page. I really appreciate anyone's support for unlocking and reading this article. In this post, I'm sharing my thoughts and experiences I've not written much about before.

Other self-taught developers will surely relate to some of the points I wrote about. Thank you!

5 Truths I've Come To Realize As a Self-taught Developer


✔️ Setting SQL_MODE

By: Michael McLaughlin

#mysql

MySQL has several SQL modes and one of them is the ONLY_FULL_GROUP_BY mode. In this short post, we learn how to create a stored procedure we can use to set the @@sql_mode for this variable.

ONLY_FULL_GROUP_BY is a very important SQL mode. Visiting the verbiage from the official documentation, we can see just why it is so important in regards to grouping type queries.

From the docs:

"Reject queries for which the select list, HAVING condition, or ORDER BY list refer to nonaggregated columns that are neither named in the GROUP BY clause nor are functionally dependent on (uniquely determined by) GROUP BY columns."

➡️ Read this post…

✔️ Convert String to Date and Date-Time in PHP

By: DeftStack Blog

#php

I swear there are like a million different ways to create a date in PHP. Although there likely aren't that many, there do seem to be quite a few.

In this post, we learn 2 different ways you can create a date from a string value using built-in PHP functions.

  1. A combination of strtotime() and date()

  2. date_create_from_format()

Date values are important and are everywhere in an application so it makes sense to know how to create them with PHP.

➡️ Read this post…



✔️ How to Find a Backdoor in a Hacked WordPress Site and Fix It

By: WPBeginner

#wordpress #php

Here is one detailed guide that I think anyone working with WordPress should get their hands on.

There are several ways someone can hack your WordPress site and while it would be impossible to cover them all in one article, I say this post is as good a start as any.

There is a ton of information in this article by the WPBeginner blog.

Just a few of the points I picked up from this post are:

  • What is a backdoor?

  • How do backdoors work?

  • Where do hackers place backdoors?

  • Examples of files that look perfectly fine, but are not a part of a WordPress site install.

I'll definitely spend more time studying this article.

➡️ Read this post…


Support OpenLampTech, my blog, and my work with a coffee if you would like.☕


✔️ PHP Access Modifiers Example

By: Websolutionstuff

#php

PHP has 3 access modifiers:

  • Public

  • Private

  • Protected

This post provides an example code block for each access modifier detailing creation and use.

Understanding the role of each level of access modifiers is very important in PHP programming because they dictate where properties and methods can be accessed.

➡️ Read this post…

✔️ Ten Tips on How to Achieve MySQL and MariaDB Security

By: Krzysztof Ksiazek

#mysql #mariadb

We should all know the importance of the security of the database as it is the heartbeat of the application. Without the data, we don't have much of anything.

The Severalnines team always publishes great content and their security-focused posts are top-notch.

While this article is a bit older (written in 2018) it nevertheless has solid information on tightening down a MySQL 5.7 or the equivalent MariaDB server.

A couple of points of interest that I learned good measures are:

  • Remove the test database

  • Obfuscate server access

  • Disable LOAD DATA LOCAL INFILE

➡️ Read this post…


Do you need to learn MySQL? Just starting out and confused about how to query a table and get the data you need? I am creating premium MySQL Beginners content for this specific reason. To help those who want to learn the basics of MySQL but don't know where to start. Learn more about my premium MySQL blog posts and content as I develop and release them, along with an actionable MySQL tip each week.

Tell me more!


⭐⭐⭐ Many of the posts I curate and share in this newsletter, I read and enjoyed on Medium. If you are not yet and member and wish to join the platform, I would be more than grateful if you would use my sign-up link. At no extra cost to you, I will receive a small portion of your membership fee when you sign up. Thank you! 🙏


Extra stuff…

  • HIGH CODE VS. LOW CODE VS. NO CODE: WHY CHOOSE JUST ONE?

  • When re-ordering columns is warranted

  • A curated library of entrepreneurship knowledge to help entrepreneurs grow a business.

  • Email Opt-In Tips

  • Running Lisp in Production


Support OpenLampTech, my blog, and my work with a coffee if you would like.☕


Did you enjoy this issue of OpenLampTech? Please share it with others so that they can enjoy the content as well. Thank you!!!

Share


Thank you for reading. I hope you have a great rest of your week.

Take care.

Joshua Otwell

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.

Share OpenLampTech


Want to support this newsletter and my work? Drop some spare change in my Tip Jar.💰

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.

Share this post

OpenLampTech issue #20

openlamptech.substack.com
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 Joshua Otwell
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing