<?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  

Recommended Answers

All 5 Replies

Member Avatar for diafol

A 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 items OR even <pre> tags with monospaced font and str_padded &nbsp;

thank you

        i want to display this slideshow dynamically  please help me. I am getting more than
        3 images if i put dynamic code

        <div class="row">
        <div id="carousel-reviews" class="carousel slide" data-ride="carousel">

        <div class="carousel-inner">
        <div class="item active">
        <!-------------------------------->
        <div class="col-md-4 col-sm-6">
        <div class="block-text rel zmin">
        <a title="" href="#">Active1</a>

        </div>
        </div>

        <!-------------------------------->
        <div class="col-md-4 col-sm-6 hidden-xs">
        <div class="block-text rel zmin">
        <a title="" href="#">Avtive2</a>

        </div>
        </div>
        <!-------------------------------->
        <div class="col-md-4 col-sm-6 hidden-sm hidden-xs">
        <div class="block-text rel zmin">
        <a title="" href="#">Avtive3</a>

        </div>
        </div>
        <!-------------------------------->

        </div><!------------------------------//item1------------------------------->   



        </div> <!---carousel-reviews ---->







        <a class="left carousel-control" href="#carousel-reviews" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel-reviews" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
        </div>
Member Avatar for diafol

I don't think that this second question is related to the original post nor the thread title. As such it is of very little use to anybody. Please post unique / non-related questions in their own threads (after searching daniweb for solutions of course).

If this is a duplicate question then may I respectfully ask that contributors go to the link posted by mattster rather than answer here.

The only contributions that should appear here are ones concerned with the original post - thank you.

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.