Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$crime_type = $_POST['search'];

$sql = "select * from criminal_tbl where crime_type=:crime_type order by case_no DESC";
$stmt = $con->prepare($sql);
$stmt->bindParam('crime_type',$crime_type);
$stmt->execute();

$stmt->setFetchMode(PDO::FETCH_ASSOC);
while ($row = $stmt->fetch()){
    echo"

            <table border="3" style="width: 100%; height: 100%"><tbody><tr align="center">                                                <td> </td>                                             <td> Information</td>                                               <td>Identity </td>                                              <td> Date of Birth </td>                                                <td> <span class="fa fa-eye"></span> </td>                                          </tr>                                     </tbody></table>
    ";

}


?>


What I have tried:

it show me table but no border please help me out
Posted
Updated 12-Mar-23 3:49am
v5
Comments
Richard MacCutchan 12-Jul-20 6:22am    
Did you really mean to create a separate table for each record?

1 solution

Quote:
it show me table

Are you sure ?
After cleaning:
PHP
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$crime_type = $_POST['search'];

$sql = "select * from criminal_tbl where crime_type=:crime_type order by case_no DESC";
$stmt = $con->prepare($sql);
$stmt->bindParam('crime_type',$crime_type);
$stmt->execute();

$stmt->setFetchMode(PDO::FETCH_ASSOC);
while ($row = $stmt->fetch()){
    echo"
        <table border="3" style="width: 100%; height: 100%">
            <tbody>
                <tr align="center">
                    <td> </td>
                    <td> Information</td>
                    <td>Identity </td>
                    <td> Date of Birth </td>
                    <td> <span class="fa fa-eye"></span> </td>  
                </tr>
            </tbody>
        </table>
    ";
}
?>

This code produce 1 table per record with a body meant to be a header and missing the real body meant to contain the data.
Are you sire the question is about this code ?
 
Share this answer
 
Comments
Ibrahim Hassan 1234 17-Jul-20 17:12pm    
yes sir, and im very gratefull to ur respond know everything is working perfectly thank you so much sir.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900