Skip to content

Instantly share code, notes, and snippets.

@jesgs
Created June 10, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesgs/cf99818a67e758d7602a5b24c84f73ce to your computer and use it in GitHub Desktop.
Save jesgs/cf99818a67e758d7602a5b24c84f73ce to your computer and use it in GitHub Desktop.
Generate a PHP array from a sql query
-- I'm lazy so this is what I did
SELECT CONCAT("['id' => ", id, ", 'some_column_string' => '", some_column, "'],") FROM mytable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment