Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

sanitize_sql_orderby()

3 tags 1 category

sanitize_sql_orderby() — Ensures a string is a valid SQL ‘order by’ clause. Accepts one or more columns, with or without a sort order (ASC / DESC). e.g. ‘column_1’, ‘column_1, column_2’, ‘column_1 ASC, column_2 DESC’ etc. Also accepts ‘RAND()’.

Inputs: $orderby (string): Order by clause to be validated.

Returns string|false: Returns $orderby if valid, false otherwise.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…