I've been learning using PHP and MySQL from the tutorial at
freewebmasterhe lp.com. Everything works fine, except deleting things.
The script is invoked with a URL like this:
And here's the script:
<?
include("dbinfo .inc.php");
$id = $_POST['id'];
mysql_connect($ server, $user, $password);
$query = "DELETE FROM test1 WHERE id = '$id'";
@mysql_select_d b($database) or die("Unable to select database.");
mysql_query($qu ery);
mysql_close();
header("Locatio n: entries.php");
?>
The dbinfo.inc.php file defines the variables $server, $database, $user
and $password. The login part works.
Gustaf
freewebmasterhe lp.com. Everything works fine, except deleting things.
The script is invoked with a URL like this:
And here's the script:
<?
include("dbinfo .inc.php");
$id = $_POST['id'];
mysql_connect($ server, $user, $password);
$query = "DELETE FROM test1 WHERE id = '$id'";
@mysql_select_d b($database) or die("Unable to select database.");
mysql_query($qu ery);
mysql_close();
header("Locatio n: entries.php");
?>
The dbinfo.inc.php file defines the variables $server, $database, $user
and $password. The login part works.
Gustaf
Comment