I am trying to take out url from the table users and insert it into url of a table images from the current user logged in. This code is not able to insert the url in the images table.
$uploaduser = $_SESSION["username"];
$selectuser = mysqli_query("SELECT * FROM users WHERE username=$uploaduser",$db1);
$row = mysqli_fetch_array($selectuser);
$pic = $row['url'];
$sql = "INSERT INTO images (image1, image_text1, uploaduser, url, date) VALUES ('$image1', '$image_text1' , '$uploaduser','$pic','$date')";
mysqli_query($db1, $sql);