Hi all,
I have a problem with a delete function. I have used this function before (with different variables) and it has worked, but this one will not. It deletes the record from the table when the link calling the function is clicked.
The function:
function delore($ore_id)
{
require "mysql.info.php";
$link = mysql_connect("$sqlhost","$sqllogin","$sqlpass") or die(mysql_error());
mysql_select_db("$sqldb",$link) or die(mysql_error());
$query="DELETE from $sqltable WHERE ore_id = $ore_id" or die(mysql_error());
}
if( isset($delete_ore))
{
delore($delete_ore);
echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL={$_SERVER['PHP_SELF']}'>";
return $query;
mysql_close();
}
The link calling the function:
{$_SERVER['PHP_SELF']}?delete_ore=$ore_id'
Any ideas? The link displays the correct function name & ore_id, and refreshes the page (so the meta freresh is working after returning the query) but the record is NOT deleted from the database !??!
TIA
Jonathen