so, I'm using one query to get the profile photo, i'm using the follow query:
$sql = "SELECT photo FROM users WHERE login = '$username'";
I already tried many ways to do, with and without the inverted commas.
$sql = "SELECT `photo` FROM `users` WHERE `login` = '$username'";
Next code is like:
$result = mysqli_query($link, $sql);
echo "<script>console.log('photo: ".$sql."');</script>";
When I check the console i see this error: Uncaught SyntaxError: missing ) after argument list
When I do the query with just "select photo from users" it returns a value.
On another page I use the same code to get the permissions and it returns a value that I want
$sql = "SELECT permission FROM users where login = '$username'";
$result = mysqli_query($link, $sql);
if ($result->num_rows > 0) {
while ($row = mysqli_fetch_array($result)) {
$save = $row[0];
}
}
Permission Column is int;
Photo Column is varchar;