<?php
{
session_start();
include "dbconnect.php";
$target1=$_SESSION['target1'];
echo $target1;
$query = "SELECT * FROM userpictures where pictures = $target1";
$result = mysql_query($query);
var_dump($result); 
    while($row=mysql_fetch_object($result)) 
echo $row;  
    {
    $_SESSION['picid1']=$row['picid'];
    //$_SESSION['picid1']=$row->picid;
    echo $_SESSION['picid1'];
    }
}
?>
it is returning me the output as images/2101.jpgbool(false) Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource
it is giving the target1 but not the picid please help.
 
    