When you are looking up a value with one query then using that value in the WHERE clause of a second query the same result can usually be achieved with a single, joined query
Code:
$sql = "SELECT COUNT(*) as numcreds
FROM order_ord o INNER JOIN tbl_users u
ON o.userid_ord = u.int_user_id
WHERE io.d_ord = '$colname_find_user' ";
$result = mysql_query($sql) or die(mysql_error());
$totalRows_old_credits = mysql_result($result, 0, 'numcreds');