Look at what you're doing. You're storing some text into a variable, $monthlyRate. Then, you use [man]mysql_query/man to query a MySQL database with that text.
Then, for whatever reason, you're retrieving how many rows were returned using [man]mysql_num_rows[/man]. Since you're not doing anything with this data, I would remove that line.
Last but not least, you're using [man]mysql_fetch_array/man to fetch the current row in the result set into an array.
If I may make a couple of suggestions, though, I would add "LIMIT 1" onto the end of your queries, since you only want one row each time:
$monthlyRate = "Select monthlyRate from subscription where planName = (Select planName from customerprofile where id = $id LIMIT 1) LIMIT 1";
Also, instead of using [man]mysql_fetch_array/man to fetch an array, you could just use [man]mysql_result/man because you're only selecting one column and one row (i.e. you're not looping through a multiple-row result set). To do that, change this:
$rs = mysql_fetch_array($query);
to:
$rs = mysql_result($query, 0);
Now, having done that, read the manual page for [man]mysql_result[/man]. What does it say it does? "Get result data." Now go look at what variable you're putting inside your INSERT query. See the mistake?