I'm not sure on the MySQL only supporting one connection at a time (I'd have to look into manuals - I'm way too tired).
However, you have a problem with your functions - you don't actually have a connection to use inside them! When you have mysql_query($sql,$db) in the function, you either need to declare "global $db;" inside the funciton, or pass the connection as an argument to the function.
I suck at explaining, so here's an example:
function dbquery($query,$conn_id) {
$result = mysql_query($query,$conn_id);
return $result;
}
or, using globals (which is generally frowned upon):
function dbquery($query) {
global $conn_id;
$result = mysql_query($query,$conn_id);
return $result;
}
I think that's it, at least.