This file contains 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 // Load items into a HTML select box via PHP & Ajax | |
$firstbox = $_POST['firstbox']; | |
$query = "SELECT * FROM mytable WHERE id_firstbox = '$firstbox';"; | |
$result = pg_query($query) or die('Query failed: ' . pg_last_error()); | |
$secondbox_arr = array(); | |
if (pg_num_rows($result) > 0) { | |
while ($row = pg_fetch_array($result, NULL, PGSQL_ASSOC)) { | |
$secondbox_arr[] = array("id" => $row['id_secondbox'], "name" => $row['testo_secondbox']); | |
} |