how to show all data. Only one row showing

Recommended Answers

All 8 Replies

row contains only one record. Every group needs to be echoed separately inside the while.

hi ItsMe5247..
pls try this

<?php 
$num =1;
$sql = "SELECT pp_number,Nationality,employer_id FROM `submission_form`";
$result = $database->query($sql);
while($row = $database->fetch_array($result)){
?>
<div id=form_group<?php echo $num; ?>>
<input type="text" value="<?php echo $row['pp_number']; ?>" class="pp_number" />
<input type="text" value="<?php echo $row['Nationality']; ?>" class="nationlity" />
<input type="text" value="<?php echo $row['employer_id']; ?>" class="registry_number" />
</div>
<?php $num++; } ?>

@rubberman I think I could say that to just about every PHP post that gets asked.

Those that aren't are normally using a framework and haave no choice aha.

Member Avatar for diafol

Without going into it too deeply, this would probably do as well with concatenating the output into a string on every iteration and then outputting a single string.

Without going into it too deeply, this would probably do as well with concatenating the output into a string on every iteration and then outputting a single string.

That would make things alot simpler I suppose, maybe he should try that.

i cant have the text box iterated because the text box are fixed

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.