Pozdrav svima
Imam jedan problem koji pokusavam popraviti skoro 2 sata ali ne vidim gde je greska.
Evo koda:
<?php
session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login.php");
}
$id = $_GET['id'];
$db = mysqli_connect('localhost', 'root', '', 'weekta');
$query = "SELECT * FROM users WHERE `id`='".$id."'";
$result = mysqli_query($db,$query);
while($row = mysqli_fetch_array($result))
{
echo $row['id'];
echo $row['username'];
echo $row['city'];
echo $row['age'];
}
?>
U podebljanom delu je problem,naime kod while($row = mysqli_fetch_array($result)) mi izbacuje error mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given
Ukoliko neko moze da mi pomogne bio bih mu stvarno zahvalan jer se mucim 2 sata a ne vidim gde je problem.
|