Skip to content

Instantly share code, notes, and snippets.

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@pjehan
pjehan / js_array_from_db_query.php
Last active August 29, 2015 14:01
Create a javascript array from an SQL query using PHP
<?php
// Search for the latitude and longitude in the database
$query = mysqli_query($con,"SELECT lat, `long` FROM shop");
// String used to store the javascript array
$locations = '';
$i = 0;
while ($row = mysqli_fetch_array($query)) {