如何为每个汽车产品添加“书籍按钮”?

I want to add "book" button to each car product.But it only display only one button for first car only.

$sql = "SELECT * FROM car";
if($result = mysqli_query($link, $sql)){
if(mysqli_num_rows($result) > 0){
    echo "<table>";
        echo "<tr>";
            echo "<th>Id</th>";
            echo "<th>Name</th>";
            echo "<th>Price(RM)</th>";
            echo "<th>Colour</th>";
            echo "<th>Mode</th>";
            echo "<th>Image</th>";
            echo "<th>Status</th>";
            echo "<td><button onclick=\"book_car('" . $row['car_id'] . 
            "')\">Book</button></td>";
    while($row = mysqli_fetch_array($result)){
        echo "<tr>";
            echo "<td>" . $row['car_id'] . "</td>";
            echo "<td>" . $row['car_name'] . "</td>";
            echo "<td>" . $row['car_price'] . "</td>";
            echo "<td>" . $row['car_colour'] . "</td>";
            echo "<td>" . $row['car_mode'] . "</td>";
            echo "<td><img src='" . $row['car_image'] . "' height='100' 
            width='100'></td>";
            echo "<td>" . $row['car_status'] . "</td>";

        echo "</tr>";
    }

There is no error.But i just want "book" button display for each car products.

This is simply because your button is out of the while loop !
Also you did not close first tr tag .
Correct code :

$sql = "SELECT * FROM car";
if($result = mysqli_query($link, $sql)){
if(mysqli_num_rows($result) > 0){
echo "<table>";
    echo "<tr>";
        echo "<th>Id</th>";
        echo "<th>Name</th>";
        echo "<th>Price(RM)</th>";
        echo "<th>Colour</th>";
        echo "<th>Mode</th>";
        echo "<th>Image</th>";
        echo "<th>Status</th>";
        echo "<th>action</th>";<!-- Added this line -->
     echo "</tr>";<!-- Added this line -->

while($row = mysqli_fetch_array($result)){
    echo "<tr>";
        echo "<td>" . $row['car_id'] . "</td>";
        echo "<td>" . $row['car_name'] . "</td>";
        echo "<td>" . $row['car_price'] . "</td>";
        echo "<td>" . $row['car_colour'] . "</td>";
        echo "<td>" . $row['car_mode'] . "</td>";
        echo "<td><img src='" . $row['car_image'] . "' height='100' 
        width='100'></td>";
        echo "<td>" . $row['car_status'] . "</td>";
        echo "<td><button onclick=\"book_car('" . $row['car_id'] . 
        "')\">Book</button></td>";<!-- Replaced This line -->

    echo "</tr>";
}
echo "</table>";


I hope this helps you :)