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

Edited by chaitu11

3
Contributors
5
Replies
24
Views
3 Years
Discussion Span
Last Post by diafol
3

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;

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

Edited by chaitu11

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.