Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. error in login page in php

error in login page in php

Scheduled Pinned Locked Moved Site Bugs / Suggestions
helpphpdatabasemysqldata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_15204309
    wrote on last edited by
    #1

    login.php if(empty($username_err) && empty($password_err)){ global $link; $sql = "SELECT id, username, password FROM users WHERE username = ?"; error line if($stmt = mysqli_prepare($link, $sql)) And here is config.php class dbConfig { private $serverName = 'localhost'; private $userName = 'root'; private $password = ''; private $dbName = 'dg_db'; protected $conn; public function __construct() { $link = mysqli_connect('localhost','root','','dg_db'); { try{ $dsn ="mysql:host={$this->serverName}; userName={$this->userName}; charset=utf8"; $options=array(PDO::ATTR_PERSISTENT); $this->conn = new PDO($dsn, $this->userName, $this->password, $options); } catch(PDOException $e) { echo "Connection Error: ".$e->getMessage(); } } } Warning : mysqli_prepare() expects parameter 1 to be mysqli, null I am stuck of this

    L 1 Reply Last reply
    0
    • M Member_15204309

      login.php if(empty($username_err) && empty($password_err)){ global $link; $sql = "SELECT id, username, password FROM users WHERE username = ?"; error line if($stmt = mysqli_prepare($link, $sql)) And here is config.php class dbConfig { private $serverName = 'localhost'; private $userName = 'root'; private $password = ''; private $dbName = 'dg_db'; protected $conn; public function __construct() { $link = mysqli_connect('localhost','root','','dg_db'); { try{ $dsn ="mysql:host={$this->serverName}; userName={$this->userName}; charset=utf8"; $options=array(PDO::ATTR_PERSISTENT); $this->conn = new PDO($dsn, $this->userName, $this->password, $options); } catch(PDOException $e) { echo "Connection Error: ".$e->getMessage(); } } } Warning : mysqli_prepare() expects parameter 1 to be mysqli, null I am stuck of this

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Wrong place; this one is for problems with the CodeProject website. Please use the Quick Answers forum at https://www.codeproject.com/Questions/ask.aspx[^].

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups