sql >> Database >  >> RDS >> Mysql

Dynamisch geketende selectiebox

$.ajax({
  type: 'post',
  url: "ajax.php."
  data: { id:'your id here' } //your id is your select box selected id.
}).done(function() { 

});

aan php-kant :

$id = $_REQUEST['id']; 
$json = array();
$sql = mysql_query("select * from yourdb where id = $id");
while ($row = mysql_fetch_assoc($sql)) {
    $json[] = $row;
}
echo json_encode($json);

ajax-ref:http://api.jquery.com/jQuery.ajax/

json-ref:http://en.wikipedia.org/wiki/JSON




  1. De tijdzone van de MySQL-server wijzigen

  2. Django JSONVeldfiltering

  3. SQLEXCEPTION-bericht ophalen in procedures MySQL 5.5.x

  4. Threadveiligheid van MySQL's Select Last_Insert_ID