Guest User

Untitled

a guest
Mar 8th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php
  2.  
  3. define('BASE_PATH', dirname(dirname(__FILE__)));
  4. define('APP_FOLDER','simpleadmin');
  5.  
  6. require_once BASE_PATH.'/lib/MysqliDb.php';
  7. $servername = "localhost";
  8. $username = "root";
  9. $password = "";
  10. $dbname = "gm";
  11. // create connection object
  12.  
  13. $db =new MysqliDb($servername,$username,$password,$dbname);?>
  14.  
  15. Fatal error: Call to undefined method MysqliDb::real_escape_string() in C:xampphtdocsGrovecus_register.php on line 11
  16.  
  17. <?php
  18. require_once './config/config.php';
  19. $msg = "";
  20. use PHPMailerPHPMailerPHPMailer;
  21.  
  22. if (isset($_POST['submit'])) {
  23.  
  24. $f_name = $db->real_escape_string($_POST['f_name']);
  25. ^ in the line of code above is where the error comes
  26.  
  27. function get_name($email_add) {
  28.  
  29. global $conn;
  30.  
  31. $sql = "SELECT * FROM tbl_customers WHERE email_add = '$email_add'";
  32.  
  33. $result = $conn->query($sql);
  34.  
  35. $row = $result->fetch_assoc();
  36.  
  37. return $row["id"];//try to use id instead of f_name
  38.  
  39. }
  40.  
  41. <?php
  42. include 'Config.php'; //The file with that code
  43. //Code with $conn variable
  44. ?>
Add Comment
Please, Sign In to add comment