Question: Can someone explain to me where I did wrong please, if i using error\_reporting its show no error but nothing happen to my database 

```
<?php
 //error_reporting(E_ERROR | E_PARSE);

 include ("db.php");
$codec=$_POST['code'];

 if(isset($_POST['code']) && !empty($_POST['code']))
 {
     $search = mysql_query("SELECT code,active FROM users WHERE code='".$codec."'  AND active='0'") or die(mysql_error()); 
     $match  = mysql_num_rows($search);

     if($match > 0)
     {
         mysql_query("UPDATE users SET active='1' WHERE code='".$codec."' AND active='0'") or die(mysql_error());
         echo '<div class="statusmsg">Your account has been activated, you can now login</div>';
     } 
     else
     {
         // No match -> invalid url or account has already been activated.
         echo '<div class="statusmsg">The url is either invalid or you already have activated your account.</div>';
     }
 }

?>  

```

Answer: 
you are having this problem here... change this line ...

```
if(!isset($_POST['code']) && !empty($_POST['code']))

```

to

```
if(isset($_POST['code']) && !empty($_POST['code']))

```
Entering `12345` in the following did in fact echo `12345` so you can base yourself on this.

```
<?php

$codec=$_POST['code'];

 if(isset($_POST['submit'])){
    if(isset($_POST['code']) && !empty($_POST['code']))
    {
echo "Code :" .$codec;
    }

}

?>

<form action="" method="post">
Code: 
<input type="text" name="code">
<br>
<input type="submit" name="submit" value="Submit">
</form>

```