hey theree, I’m a complete newbie to all this php stuff as well as mysql; but I’ve gotten familiar with a few things including how deletion works. I’m creating a website for a project, unfortunately my deactivation won’t work. I’ve looked it over a million times but it simply won’t delete the information from my table in mysql. The code is below, help?
Username: Password: <input type="password" name="passworddel" />
<input type="submit" name="submit2" value="Deactivate Account" /></form></table><br /></p>
<?php
$con=mysql_connect("hostname","dbname","Password");
if(!$con){
die('Could not connect: ' . mysql_error());
}
mysql_select_db("dbname", $con);
if(isset($_POST['submit2'])){
$usernamedel=$_POST['usernamedel'];
$passworddel=$_POST['passworddel'];
mysql_query("DELETE FROM table WHERE username='$usernamedel' and password='$passworddel'");
mysql_close($con);
echo "Your account has been deactivated $usernamedel";
}
?>