$sql = "SELECT id, reason, picture FROM posted WHERE id BETWEEN $set_min AND $set_max"; //query string
$result = mysql_query($sql) or die (mysql_error()); // run a single query only once, show error on failure
while ($row=mysql_fetch_assoc($result)){ //run through the results using $row array to address returned fields by field name
//your code start
$reason = $row[reason];
$pulled_id = $row[id];
$pulled_pic22 = $row[picture];
$href_pull = "<a href=" . "search.php?id=" . "$pulled_id" .">";
echo "<td>" . $href_pull . "<img src=$pulled_pic22 height=200 width=150 />" . "</td>";
//your code end
}//job done
it works exactly like i want! thank you for your help!