I think you've just got your variables and your column names flip-flopped here.
//correct
$query="SELECT * FROM table WHERE column='$column'";
//incorrect
$query="SELECT * FROM table WHERE '$column'=column";
//corrected version of your code
$sql3="SELECT * FROM table1 WHERE uname='$uname'";
$result = mysql_query($sql3);
$num_rows = mysql_num_rows($result);
$sql4="UPDATE table2 SET counter='$num_rows' WHERE uname='$user_name'";
I'm sure you know this already, but if you just want to add a comment to a single line, // works and is quicker than / /
Also, it looks like you just use two /, but you need to use / then */