i have tryed laying it out like this:
$sql = "SELECT id from table2 WHERE column2 = '$field1'
$pcategoryid = mysql_query($sql)
if that is what you mean but i still do not receive the value needed. I do not receive any errors from the code but the field in the database just changes to "0".
basically $field1 variable is from the post form,
$field1 needs comparing with where clause with the column2 in table2,
and then the id found in table 2 needs placing into table 1.