php - Query not executed as expected -


i working on user's registration system. url called activate user's account:

http://../verify.php?id=40&code=fdc6604289e5a58fe1ab9dffa8e2f870

and code verify.php:

<?php require_once 'class.user.php'; $user = new user();   if(empty($_get['id']) && empty($_get['code'])) {     $user->redirect('index.php'); }  if(isset($_get['id']) && isset($_get['code'])) {     $id = $_get['id'];     $code = $_get['code'];      $statusy = "y";     $statusn = "n";      $stmt = $user->runquery("select userid,userstatus tbl_users userid=:uid , tokencode=:code limit 1");     $stmt->execute(array(":uid"=>$id,":code"=>$code));     $row=$stmt->fetch(pdo::fetch_assoc);     if($stmt->rowcount() > 0)     {         if($row['userstatus']==$statusn)         {             $stmt = $user->runquery("update tbl_users set userstatus=:status userid=:uid");             $stmt->bindparam(":status",$statusy);             $stmt->bindparam(":uid",$id);             $stmt->execute();                 $msg = "                    <div class='alert alert-success'>                    <button class='close' data-dismiss='alert'>&times;</button>                       <strong>wow !</strong>  account activated : <a href='index.php'>login here</a>                    </div>                    ";            }         else         {             $msg = "                    <div class='alert alert-error'>                    <button class='close' data-dismiss='alert'>&times;</button>                       <strong>sorry !</strong>  account allready activated : <a href='index.php'>login here</a>                    </div>                    ";         }     }     else     {         $msg = "                <div class='alert alert-error'>                <button class='close' data-dismiss='alert'>&times;</button>                <strong>sorry !</strong>  no account found : <a href='signup.php'>signup here</a>                </div>                ";     }    }  ?> <!doctype html> <html>   <head>     <title>confirm registration</title>     <!-- bootstrap -->     <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">     <link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">     <link href="assets/styles.css" rel="stylesheet" media="screen">      <!-- html5 shim, ie6-8 support of html5 elements -->     <!--[if lt ie 9]>       <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>     <![endif]-->     <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>   </head>   <body id="login">      <div class="container">         <?php if(isset($msg)) { echo $msg; }         ?>     </div> <!-- /container -->     <script src="vendors/jquery-1.9.1.min.js"></script>     <script src="bootstrap/js/bootstrap.min.js"></script>    </body> </html> 

this record database: enter image description here

the problem $_get['id'] , $_get['code'] correct values, page shows option: no account found...

i searching reason hours, no success.

any find source of issue welcome


Comments