<?php
include('db.php');
$query=mysqli_query($con,"select * from reg");
while($row=mysqli_fetch_array($query)) {
echo $id;
echo $name;
}
?>
i want to display it as follows:
1.chaitanya 2.swati
3.rena 4.geeta
chaitu11
0
Junior Poster
Recommended Answers
Jump to PostA simple one...
$output = ''; $x = 0; while($row=mysqli_fetch_array($query)) { $output .= $row['id'] . '. ' . $row['name'] . " "; if($x%2 == 0) $output .= "<br />"; $x++; }
However if you want fixed width items, then either make a table or fixed-width list …
All 5 Replies
diafol
chaitu11
0
Junior Poster
chaitu11
0
Junior Poster
mattster
195
Practically a Master Poster
Featured Poster
diafol
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.