How To get_posts in WordPress with Multiple meta_query Values

Author: , October 13th, 2020

The first query gets all custom publication posts that have a value in field book_seq ordered by book_seq The second query gets all custom publication posts that have no meta value for book_seq or no meta record for key book_seq ordered by post_title.

Great article here: https://rudrastyh.com/wordpress/meta_query.html

How To Dual-Sort Query Results In WordPress Using get_posts

Author: , September 12th, 2019

Needed to build a feature for a Bookstore tool to have an optional sequence number for the Custom Post Type “books” that would allow items with a seq number to float to the top of the list and be sorted by seq #. The rest of the books would show underneath, sorted alphabetically.

How To Select Rows in MySQL with No Matching Entry in Another Table

Author: , May 16th, 2018

SELECT t1.id FROM tableOne t1 LEFT JOIN tableTwo t2 ON t1.id = t2.id WHERE t2.id IS NULL The “WHERE t2.id IS NULL clause” restricts the results to only those rows where the id returned from tableTwo is null. tableTwo.id will be NULL for all records from tableOne where the id is not found in tableTwo.

How To Get the URL in Javascript Without the Query String

Author: , August 29th, 2013

window.location.href.split(‘?’)[0]

How To Create a List of Reports, Queries or Tables in Microsoft Access

Author: , February 25th, 2012

This query will list the names of the reports in the database: SELECT MSysObjects.Name AS Report_Name FROM MSysObjects WHERE (((MSysObjects.Type)=-32764)) ORDER BY MSysObjects.Name; This query will list the names of the queries in the database: SELECT MSysObjects.Name FROM MSysObjects WHERE (((MSysObjects.Type)=5)); This query will list the names of the tables in the database: SELECT MSysObjects.Name […]

How To Return Line Numbers In MySQL

Author: , October 14th, 2011