10's a bit high for a MySQL link identifier, unless you're holding 10 open connections to MySQL in your script, or close/reconnect for each query. Are you trying to pass a previous query result instead of the DB handle? Something like this:
$dbh = mysql_connect(...);
$stmt = mysql_query('SELECT ...', $dbh);
and later on after a series of queries, maybe doing
$stmt = mysql_query('SELECT ...', $stmt); // <--using $stmt instead of $dbh
As well, though not likely, mixing mysqli and mysql handles isn't supported. They both do the same stuff and use the same libraries internally, but maintain seperate connection pools which can't be shared.