This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Accept select box id (as string) and return the selected options as an array. | |
* @param {String} selectID HTML id for the select box. | |
*/ | |
function getSelectedOptions(selectID) | |
{ | |
var result = []; | |
var options = document.getElementById(selectID).options; | |
for (var i = 0; i < options.length; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create MySQL connection. Params=(host, DB username, DB passwword, name of Database) | |
$db = mysqli_connect('localhost','username','password','db-name') | |
or die('Error connecting to MySQL server.'); | |
// Create query | |
$query = "SELECT * FROM TABLE"; //Add whatever query desired | |
// Query database using variables | |
mysqli_query($db, $query) or die('Error querying database.'); |
NewerOlder