this is my PHP function
$sql = "SELECT * FROM `users` WHERE `id` = '".$_SESSION['id']."'";
$result = mysql_query($sql, $db_connection);
$row = mysql_fetch_assoc($result);
$sql = mysql_query("INSERT INTO medrecherche VALUES('','$medname','{$_SESSION['id']}')");
And I need it to execute at the same time I'm clicking on a result from the search bow that I'm developing,
my js function is the one below :
function set_item(item) {
// change input value
$('#medicine_id').val(item);
// hide proposition list
$('#listmed').hide();
}
Called like that in index.php
<div class="input_container">
<input type="text" id="medicine_id" onkeyup="autocomplet()" >
<ul id="listmed"></ul>
</div>