I would like to make a ranking.
In Table1 I collect the ID, Name, ExperiencePoint, and LvL.
Table1
In Table2 I have the LvL and the ExperiencePoint.
- 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
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')";
$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";
$query="select id from table2 where $lvl>=$xp LIMIT 0 , 1"; But how can I join the selection, and put it in the insert?