Hey I have following code:
<tbody>
<?php
$connection = mysql_connect("localhost", "root", "") or die("Could Not Connect to DB: ".mysql_error());
$db = mysql_select_db("DBNAME", $connection) or die("Could Not Connect to DB: ".mysql_error());
$result = mysql_query("SELECT * FROM product");
while($row = mysql_fetch_row($result))
{
echo "<tr class='odd gradeX'>
<td>{$row[0]}</td>
<td>{$row[1]}</td>
<td>{$row[2]}</td>
<td>{$row[3]} x {$row[4]} x {$row[5]}</td>
<td>{$row[6]}</td>
<td>{$row[7]}</td>
<td>{$row[8]} Rs.</td>
<td><a href='' onclick=''>Edit</a></td>
<td><a href='' onclick=''>Delete</a></td>
</tr>";
}
?>
</tbody>
Now if I want to edit or delete any data and fire query then what should I do to perform that task. I tried using Js using onclick event and calling function but I don't know how to fetch id.
{row[0]} is the ID of table product.