I have a script that pulls some info from a database and displays it in a table, but it will show an unlimited amount of rows, so how can i for example add a second page to the results after lets say 20 results? $req = "SELECT *," . $table . ".id as id_res from $table, $table1 where " . $table . ".player_id = " . $table1 . ".id order by player_name;"; $res = mysql_query($req); $number = mysql_num_rows($res); PHP: Thanks for the help!
$postsperpage=20; $start = isset($_POST['page']) && is_numeric($_POST['page'])?$_POST['page']*$postsperpage:0; $req = "SELECT *," . $table . ".id as id_res from $table, $table1 where " . $table . ".player_id = " . $table1 . ".id order by player_name LIMIT ".$start.","$postsperpage";"; $pages = ceil(mysql_result(mysql_query("SELECT COUNT(*) from $table, $table1 where " . $table . ".player_id = " . $table1 . ".id order by player_name;),0)/$postsperpage); PHP: