I understand now what you mean about redoing the $sql variable
ok ill explain it a different way.
i have table with 4 columns
STATE CATAGORY VISITORNUMBER PAGECOUNT
VISITORNUMBER is already set as=$hits
now i need to search VISITORNUMBER row until it finds $hits then ineed to put into STATE column results of varible $state
