0

I am trying to echo information into a slider , but, it keeps repeating the entire slider instead of jus inserting the fields aloone. i know it is the closing tag but i dont know how else to do it..any ideas? i just want to post like address 1 address 2 addreess 3 in decending order form the search.

<?php

while($row=mysql_fetch_array($result)){
$file=$row ['photourl'];




?>
        <div class="body2">
            <div class="main">
                <section id="content">
                    <div class="wrapper">
                        <article class="col1">

                            <div id="slider">
                              <img src="images/img1.jpg" alt="" title="<strong><?php echo $row['address'] ?></strong><span> <?php echo $row['bathroom'] . " bathrooms," .  $row['bedroom'] . " bedrooms"?> Price: <?php echo $row['price'] ?> &nbsp; &nbsp; <a href='view-prop.php?address=<?php echo $row['address'] ?>'>Read more</a></span>">
                                <img src="images/img2.jpg" alt="" title="<strong><?php echo $row['address'][1] ?></strong><span>8 rooms, 4 baths, 4 beds, building size: 4500 sq. ft. &nbsp; &nbsp; &nbsp; Price: $ 500 000 &nbsp; &nbsp; &nbsp; <a href='chateau-lingfield.html'>Read more</a></span>">
                                <img src="images/img3.jpg" alt="" title="<strong><?php echo $row['address'][2] ?><span>8 rooms, 4 baths, 4 beds, building size: 4500 sq. ft. &nbsp; &nbsp; &nbsp; Price: $ 500 000 &nbsp; &nbsp; &nbsp; <a href='property.html'>Read more</a></span>">

                            </div>

                        </article>
<?php
}
?>
3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by vibhaJ
1

Hi,

Move all these before the while loop..

 <div class="body2">
  <div class="main">
  <section id="content">
  <div class="wrapper">
  <article class="col1">
  <div id="slider">

and then after the closing curly bracket of your while loop, move these.

    </div>
    </article>

By the way, where is the opening tag of article?

1

Make sure any tag doesn't break.
Try below code i have used photourl as image src.

<div class="body2">
  <div class="main">
    <section id="content">
      <div class="wrapper">
        <article class="col1">
          <div id="slider">
            <?php
                while($row=mysql_fetch_array($result))
                {
                ?>
                <img src="<?php echo $row['photourl'] ?>" alt="" title="<strong><?php echo $row['address'] ?></strong><span> <?php echo $row['bathroom'] . " bathrooms," .  $row['bedroom'] . " bedrooms"?> Price: <?php echo $row['price'] ?>     <a href='view-prop.php?address=<?php echo $row['address'] ?>'>Read more</a></span>">
                <?php
                }
                ?>
          </div>
        </article>
      </div>
    </section>
  </div>
</div>
This topic has been dead for over six months. 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.