My database holds a table with the names of 30 users. I have the following html form which is a search form:
<form method="POST" name="go" action="search_form_all.php" >
<input name="value" type="text" id="search_form_1" size="65" />
<input type="submit" value="" name="submit" />
</form>
Then usign the following php script, the form as a result displays all names from my database:
if(isset($_POST['value'])== true && empty($_POST['value']) == false){
$value = mysql_real_escape_string($_POST['value']);
$name_and_surname = explode(" ", "$value ");
$name = $name_and_surname[0];
$surname = $name_and_surname[1];
$query = mysql_query(" SELECT `name`, `surname`, `email`, `user_id` FROM users WHERE (surname LIKE '$name%' AND name LIKE '$surname%') OR (surname LIKE '$surname%' AND name LIKE '$name%') LIMIT 10 ");
while($run = mysql_fetch_array($query)){
$name = $run['name'];
echo" $name ";
}
by executing the above code, I get the first 10 names (because in my sql query have limit 10). All I want is to have a button that when the user press it to extract the rest 10 names and then the rest 10 until all 30 names extracted. How can I do this?