阅读背景:

PHP数据库删除功能只适用于第一行数据库?

来源:互联网 
    <p><?php include 'header.php'; ?></p>
    <div align="justify">

        <td>Name:<input type="text" name="password" ></td> <!-- database -->
        <td>&nbsp; Rank:<select>
                <!--<option value="volvo">//Database</option>
                    <option value="saab">Saab</option>
                -->
                <?php
                require ("dbfunction.php");
                $con = getDbConnect();

        <td>&nbsp;<input type="checkbox" name="vehicle" value="Bike">Group by Rank</td> <!-- database -->
        <td>&nbsp;<input type="checkbox" name="vehicle" value="Bike">Include previous service terms</td>  <!-- database -->
    </div>
    <p><table>
        <tr>
            <th>Name</th>
            <th>Rank</th>
            <th>Start Date</th>
            <th>End Date</th>
            <th>Watchkeeping</th>
            <th>Active</th>
            <th></th>
            <th></th>
        </tr> <!-- database -->
        <tr> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
            <?php
            if (!mysqli_connect_errno($con)) {

                $queryStr = "SELECT * " .
                        "FROM crewlist";
            }
            $result = mysqli_query($con, $queryStr);
            while ($row = mysqli_fetch_array($result)) {
                 //echo "<div><a href=https://localhost/poshproject/crewlisting.php?crew_name={$row["crew_id"]}>";


                echo "<tr>.<th>" . $row["crew_name"] . "<br></br>" . "</th>";
                echo "<th>" . $row["crew_rank"] . "</th>";
                echo "<th>" . $row["start_date"] . "</th>";
                echo "<th>" . $row["end_date"] . "</th>";
                echo "<th>" . $row["watchkeeping"] . "</th>";
                echo "<th>" . $row["active"] . "</th>";
                echo "<td><a href=\"editcrew.php?id=" . $row['crew_id'] . "\">Edit</a>";
                //echo "<td><center><button type=\"submit\" name=\"Delete\" value="' . $row['crew_id'].'"/>Delete</button></center></td>";
                echo "<td><a href=\"delete.php?id=" . $row['crew_id'] . "\">Delete</a>";
            }
            ?>
            <!--                
                            <td><center><button type="submit" value="Edit">Edit</button></center></td>
                    <td><center><button type="submit" value="Delete">Delete</button></center></td>-->
        </form></tr>

    </tr>
</table>
    <p><?php include 'header.php'; ?></p>
    <



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: