Search for all results in MYSQL database

This script displays the first mask result from the table Table. How to find and withdraw all results satisfying condition?

$search=$_POST['search'];
if(is_string($search)){
    clear($search);
    $link = mysql_connect("localhost", "root", "") or die(" !!!");
    mysql_select_db("Rate") or die("  ");
    $result=mysql_query("SELECT * FROM table WHERE name LIKE '%$search%'") or die('    '.mysql_error());
    $line = mysql_fetch_array($result);
    #   POST 
    $id=$line['id'];
    $name=$line['name'];
    # 
    echo "<b>id:</b> ".$id;
    echo "<b>:</b> ".$name;
}

Answer 1, Authority 100%

$result=mysql_query("SELECT * FROM table WHERE name LIKE '%".$search."%'") or die('    '.mysql_error());
$i = 0;
while ($line = mysql_fetch_array($result)) {
$i++;
$id = $line['id'];
$name = $line['name'];
print "Row ".$i.": ".$name." and ".$id."<br>";
}