Ahh, the joys of debugging :) My first steps in this situation would be to do some basic checks to make sure the queries are running correctly.
For example, try putting:
under your first mysql_fetch_array() to see if your query is actually getting any results. If that works ok, put an " or die(mysql_error());" statement after your second mysql_query() ($web2) to see if that produces any errors. If that's all ok, then the next step would be to remove the while() loop and replace it with:
On the fourth line you are trying to get the value of $mas['tuto_id'], but in your SQL query you only ask for the rate and no other columns. Therefore, tuto_id will not be available to use! The same problem exists for the query assigned to $web2 since no valid ID number is available.
It is good practice to add in some checks into your scripts so that you can recognise errors or problems. You should always check to see whether MySQL encountered any error when processing a query (mysql_query returns FALSE on error). Also you should check to see if the returned resuls are what you were looking for. For example, if no rows were returned you should output a message saying that nothing was returned, rather than just outputting nothing.
Ok, so that means that $mas2 = false - when in reality, you where expecting it to contain an array (the rows from your query).
As such, it's probably a good guess that your query:
"select * from tuto where id='$mas[tuto_id]'"
Is not returning any results. Looking at your query and your debugging results posted above, I can see that it's the "..where id='$mas[tuto_id]'" that is the problem.
If you take another look at your first var_dump() results, you will see that your query is only returning ['rate'] - which in this case equals 5. As such, $mas['tuto_id'] doesn't exist as your query doesn't return it.
I would recommend changing your first query so that it fetches tuto_id as well. This should resolve your problem.
Just remember in future, if in doubt - stick var_dump() statements all over your code until you track down the problem
In that case, I would use a query like the following:
$web = "SELECT tuto_id, rate FROM tuto ORDER BY rate DESC LIMIT 1";
This would select 'tuto_id' and 'rate' from the 'rate' table. It then sorts them by 'rate' in descending order (ie, highest first), then limits the results to 1. That way, you should only end up with 1 row, the one with the highest rating, containing the tuto_id and rate values.
Note: No-one has ever mistaken me for an SQL expert so I don't know if my query above is the "right" way to do it, but if it's wrong I'm sure someone else here can improve it
Then you need to do some debugging to find out where the problem is. For example, it looks like I mistyped something in the second query, so put an " or die(mysql_error())" after your mysql_query() and that should give us an error message.
You can then use this error message to track down the problem.