<?php
$conn = db2_connect("TEST", "db2admin", "password123");
// Create the test table
//$create = 'CREATE TABLE animals (id INTEGER, breed VARCHAR(32),
// name CHAR(16), weight DECIMAL(7,2))';
//$result = db2_exec($conn, $create);
//if ($result) {
// print "Successfully created the table.\n";
//}
// Populate the test table
$animals = array($_POST['data']);
foreach ($animals as $animal) {
$rc = db2_exec($conn, "DELETE FROM animals WHERE id = {$animals[0]}");
if ($rc) {
echo "<a href='index.php'>GO HOME</a>";
}
}
?>
ERROR
Notice: Undefined index: data in C:\xampp2\htdocs\DB2\del.php on line 13
Warning: db2_exec(): Statement Execute Failed in C:\xampp2\htdocs\DB2\del.php on line 16