OpenLampTech No. 145
Sharing sawdust | 7 PHP questions | MariaDB vector preview | PHP variables in jQuery | First Linux bash script |
Thank you for reading the OpenLampTech newsletter!
If someone awesome shared this newsletter with you and you are not yet subscribed, please use the Subscribe button below and join:
OpenLampTech has sponsorship opportunities for your brand, product, or service in the weekly newsletter. As an independent publication, collaboration is very affordable.
All commentary is mine unless otherwise quoted.
If You Can Answer These 7 Questions Correctly You’re Decent at PHP
There are some good points in this article. Yes, a lot of PHP is easy to get a grasp on. It's the small intricacies that get you (like most programming languages).
One of the more important concepts I picked up here is about Loose Equality Comparison (==) and Strict Equality Comparison (===) and how PHP handles non-integer strings in loose comparisons.
[Medium]
How to Create Your First Linux Bash Script
Shell scripting is a superpower in my opinion. The more I use it, the more I realize just how efficient shell scripting can be. I've used small, powerful shell scripts to do anything from renaming a batch of photos on a personal project to keeping Composer packages up-to-date on several websites running on the same server.
[The New Stack]
MariaDB Introduces Open-Source Vector Preview, Aiming to Become Default MySQL Option
Most of (if not all) MySQL Vector (search) support is in Heatwave. Since it's a premium-only feature not found in the free community MySQL edition, perhaps some see as this a shortcoming.
MariaDB aims to differentiate itself by offering Vector Search capabilities out of the box.
[InfoQ]
[Affiliate]
Consuming APIs in Laravel - Learn how to confidently integrate third-party APIs in your Laravel projects using maintainable, testable, and extensible code.
Here lately, at least 9 out of 10 times, I'm using a CASE statement for conditional logic in SQL. CASE just feels more flexible to me, although you could embed several IF-ELSE if needed. But, that would turn into a mess real quick.
The catch is that while you can use CASE in queries and stored procedures, IF-ELSE is allowed only in stored procedures and not regular queries.
[Medium]
How To Use PHP Variables in jQuery
I feel like jQuery gets a lot of flack. Especially compared to more modern JavaScript libraries. However, jQuery is still used a lot in WordPress and WooCommerce. You can use PHP variables in jQuery code with the json_encode() function. Typically, you would assign the return value to a variable in jQuery: var variable_name = <?php echo json_encode($some_variable); ?>;
See more examples and how to use a PHP variable with the jQuery data attribute in this article.
[WP SITES]
WooCommerce updates and news
WooCommerce 9.2: A better experience for all users (08-21-2024)
The Classic Product Editor (form) is receiving a global unique ID. The global_unique_id field is similar to an SKU and allows for a unique text type value.
“…a new database option: woocommerce_hooked_blocks_version to facilitate a new approach to block insertion.”
Sharing sawdust…
This is a new section in OpenLampTech where I'm sharing one small SQL, PHP, or other coding snippet/thought/discovery/useful piece of information.
It may be useless to many people but at one time, I've found it useful for something (likely even learned a hard-earned lesson from it). Maybe you will too.
Not sure why you would ever need this (can’t honestly remember why I learned it), but if you ever want to know what the next AUTO_INCREMENT value is for a MySQL table (that has this attribute on a column), this query will retrieve it:
SELECT `AUTO_INCREMENT`
FROM `information_schema`.`TABLES`
WHERE `TABLE_SCHEMA` = 'some_database_name'
AND `TABLE_NAME` = 'some_table_in_said_db';[#Affiliates and Classifieds] - Your support keeps the OpenLampTech newsletter free for readers
Ultimate Laravel Boilerplate to help other indie hackers deliver their SaaS in hours. Get started with LaraFast today! (affiliate)
Popups, newsletters, and abandoned carts. Use Omnisend with integrated email and SMS campaigns. (affiliate)
Check out the Ecommerce Coffee Break newsletter (and podcast) for the latest in Shopify news. (subscriber incentive)
The latest ShutterCraft 101 newsletter is published and available if you are interested in my photography journey.
Thank you for reading. I hope you have a great rest of your week.
Take care.
Josh Otwell
Some links may be affiliate links from which I earn a small commission at no additional cost to you.


