CZY MOGŁBY KTOS MI POMÓC NA CZYM POLEGA TEN BŁĄD. Drugi dzien sie mecze i niestety nadal to samo??
0
<?php
class Database{
private $host;
private $db_name;
private $username;
private $password;
public $conn;
// get the database connection
public function connect(){
$this->host = "localhost";
$this->db_name = "spot";
$this->username = "root";
$this-> password = "";
$this->conn = new mysqli($this->host, $this->username, $this->password, $this->db_name);
if($this->conn->connect_errno){
print_r($this->conn->connect_error);
exit;
}else{
return $this->conn;
}
}
}
?>
<?php
class Users{
public $email;
public $encrypted_password;
public $username;
public $age;
public $place_of_residence;
public $name_passion;
public $picture_passion;
public $id_user;
private $conn;
private $users;
private $user_passjion;
public function __construct($db) {
$this->conn = $db;
$this->users = "users";
$this->users = "user_passjion";
}
public function create_user(){
$user_query = "INSERT INTO".$this->users."SET email = ?, encrypted_password = ?, username = ? ";
$user_obj = $this->conn->prepare($user_query);
$user_obj ->bind_param("sss", $this->email, $this->encrypted_password, $this->username);
if($user_obj->execute()){
return true;
}
return false;
}
}
?>
1
Używając Caps Lock krzyczysz na osoby, które to czytają, co może je zniechęcić.
Komunikat mówi jasno i wskazuje linijkę, gdzie jest błąd. Co masz w tej linijce?
0
jurek1980 napisał(a):
Używając Caps Lock krzyczysz na osoby, które to czytają, co może je zniechęcić.
Komunikat mówi jasno i wskazuje linijkę, gdzie jest błąd. Co masz w tej linijce?
klasa User(). Błąd pojawia się gdy chce wywolac zapytanie. : $user_obj = $this->conn->prepare($user_query);