I have this code in html:
<a id="<?echo $result[id]?>" onclick="displayResult()"></a>
And i want to get this id number from link without refresh the page to this function:
<script>
function displayResult()
{
<?
connection = mysql_connect('localhost', 'root', '...');
$db = mysql_select_db('webfaturas', $connection);
$sql = mysql_query("SELECT * FROM `artigos` WHERE id = $id");
$resultado = mysql_fetch_array($sql);
?>
</script>
So i can do sql query WHERE id = id that cames from without refresh the page.