Eroare
Cod: Selectaţi tot
Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\xampp\htdocs\login\core\functions\utilizatori.php on line 80
imgur.com/Kahj6Gl
Cod: Selectaţi tot
Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\xampp\htdocs\login\core\functions\utilizatori.php on line 80
Cod: Selectaţi tot
$data =[];
$conn = new mysqli('localhost', 'root', '', 'login');
$sql = "SELECT $campuri FROM utilizatori WHERE id = $id";
// executa interogarea si retine datele returnate
$result = $conn->query($sql);
// daca $result contine cel putin un rand
if ($result->num_rows > 0) {
// retine datele din fiecare rand din $result
while($row = $result->fetch_assoc()) {
$data[] = $row;
}
}
Cod: Selectaţi tot
var_dump($campuri);
var_dump($id);
Cod: Selectaţi tot
echo $sql;