PHP - output associate array into HTML <div>s with labels/headings -
i have php function returns single row localhost mysql table so:
<?php //include database connection process require_once("includes/conn.inc.php"); //prepare statement $stmt = $conn->prepare("select * races raceid = ?"); $id = 1; $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); $row = $result->fetch_assoc(); ?>
what array output data individual fields in own html <div>
or <p>
heading indicating mean in separate div. user print_row
method outputs in one. data want there, i'd separated out name/value paragraphs or divs.
//what have <?php print_r($row); ?>
is there way this?
thanks in advance,
mark
i didn't understand question think understand need.
use while iterate trough each row.
while($row = $resultdesc->fetch_assoc()) { echo '<p><strong>description:</strong></p> '; echo '<p>'. $row['description'] . '</p>'; }
that's not exact solution atleast shows path.
Comments
Post a Comment