Hi. Hope someone can help me with my php code. This is a piece of the code that is retrieving data from a MySQL database. The code works to list the results, but I would like to display them in a table. i would appreciate any suggestions. Thank you.
//get all car_desc
$get_car_sql = "SELECT car_id, year, model, body_num, engine_num, designer, builder, body_style, cond FROM car_desc
WHERE mbr_id = '".$_POST["sel_id"]."'";
$get_car_res = mysqli_query($mysqli, $get_car_sql) or die(mysqli_error($mysqli));
if (mysqli_num_rows($get_car_res) > 0) {
while ($car_info = mysqli_fetch_array($get_car_res)) {
$car_id = stripslashes($car_info['car_id']);
$year = stripslashes($car_info['year']);
$model = stripslashes($car_info['model']);
$body_num = stripslashes($car_info['body_num']);
$engine_num = stripslashes($car_info['engine_num']);
$designer = stripslashes($car_info['designer']);
$builder = stripslashes($car_info['builder']);
$body_style = stripslashes($car_info['body_style']);
$cond = stripslashes($car_info['cond']);
$display_block .= "<p>$car_id<br>$year<br>$model<br>$body_num<br>$engine_num<br>$designer<br>
$builder<br>body_style<br>$cond</p>";
}
}
//free result
mysqli_free_result($get_car_res);