Advertisement
rahat62

Notice: Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\Project2\verify.php on line 10

Oct 14th, 2020
2,209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2. if (isset($_GET['vkey'])){
  3.     //verification process
  4.     $vkey = $_GET['vkey'];
  5.  
  6.     $mysqli = NEW MySQLi('localhost','root','','bookfly');
  7.  
  8.     $resultSet = $mysqli->query("SELECT verified, vkey FROM signuptable WHERE verified =0 and key = '$vkey'LIMIT 1");
  9.  
  10.     if($resultSet->num_rows == 1){
  11.         //validated the email
  12.         $update = $mysqli->query("UPDATE signuptable SET verified = 1 WHERE vkey='$vkey' LIMIT 1");
  13.         if($update){
  14.             echo "Your Account has been verified . You may login now.";
  15.         }
  16.         else{
  17.             echo "$mysqli->error";
  18.         }
  19.     }
  20.     else{
  21.         echo "This account is invalid or already verified ";
  22.     }
  23. }
  24. else
  25. {
  26.     die("Something Went Wrong");
  27. }
  28. ?>
  29. <html lang="en">
  30. <head>
  31.     <meta charset="UTF-8">
  32.     <title>Title</title>
  33. </head>
  34. <body>
  35.  
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement