Hello. Help with this code. The point is to take a sample from the database and issue it in php page by page. There is a code that works when the sample is complete. When I add a search form, he considers the page correctly, but on going to another page, the variable gets lost, and I have an empty screen. I understand this variable as it should be saved when moving to the next page, but how. Here is the code itself (at the top in the Html search box):
include('adm/connectdb.php'); $num = 8; if (isset($_POST['search'])) { $page = $_GET['page']; $result = mysql_query("SELECT COUNT(*) FROM `db1` WHERE `name`LIKE \"%$search%\""); $posts = mysql_result($result, 0); $total = intval(($posts - 1) / $num) + 1; $page = intval($page); if (empty($page) or $page < 0) $page = 1; if ($page > $total) $page = $total; $start = $page * $num - $num; $result = mysql_query("SELECT * FROM `db1` WHERE `name`LIKE \"%$search%\" LIMIT $start, $num"); while ($postrow[] = mysql_fetch_array($result))
$_POSTvariable, use$_GET. By the way, what's in the$searchvariable? - Egor Smolyakov