echo "<table cellpadding=5 border=1>";
foreach ($array as $value) {
echo "<tr><td>".$value['title']."</td>";
echo "<td>".$value['author']."</td>";
echo "<td>".$value['year']."</td>";
echo "<td><button onClick=\"location.href='delete.php?id=$value['id']'\">delete</button></td></tr>";
}
echo "</table>";
Just to say on start, this is test code, for my own practise.
I am getting error when i put id in ' ' like this : $value['id']. It is some string error i guess, tried like dozen ways to get out of it.
On delete.php i have $id=$_GET['id'];
which will take sent id, but nothing is sent.
Thanks, Michael