I would like to make a ranking.
Table1
- ID
- Name
- ExperiencePoint
- LvL.
Table2
- LvL
- ExperiencePoint.
I would like to collect the data via form, into Table1. Now, everybody have to write the XP, and LvL.
It would be better, if they post the XP, and the LvL automatically come from Table2.
I insert datas into table with this:
$mysql ="INSERT INTO $table (id, name, xp, lvl) VALUES ('$id','$name','$xp','$lvl')";
And select the lvl with this:
$query="select id from table2 where $lvl>=$xp LIMIT 0 , 1";
But how can I join the selection, and put it in the insert?