0

Ok so i have been searching but this specific part i cant get, how do i echoinformation from my sql database with php into my div so i keep the same formating

<div class="wrapper pad_bot3">
<figure class="left marg_right1"><img src="images/page1_img4.jpg" alt=""></figure>
<p class="pad_bot1"><strong class="color2">Chateau Lingfield</strong></p>
<p class="pad_bot1"><strong class="color2">3 baths, 6 beds, building size: 5000 sq. ft.<br>
 Price: <span class="color1">$ 600 000</span></strong></p>
<a href="#" class="button">Read more</a>
</div>


i was thinking something like this? but it dosent work

<div class="wrapper pad_bot3">
echo " <figure class="left marg_right1"><img src=$row['photourl'] alt=""></figure>";
echo " <p class="pad_bot1"><strong class="color2">$row['parish']</strong></p>";
echo "<p class="pad_bot1"><strong class="color2">$row['bedroom'],$row['bathroom'] <br>";
echo " Price: <span class="color1">$row['status'] </span></strong></p>
<a href="#" class="button">Read more</a>
</div>

Edited by realworldmedia: question wasnt asked properly

3
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by realworldmedia
0

this is what i have that works

?>
<table border=1 align = "center" style="background-color:#ff1414;" >
<caption><h2>Property Details</h2></caption>
<tr>
<th align='center'><h4>Pictures</h4></th>
<th align='center'><h4>Description</h4></th>
<th align='center'><h4>Parish</h4></th>
<th align='center'><h4>Bedroom</h4></th>
<th align='center'><h4>Bathroom</h4></th>


</tr>
<?php

while($row=mysql_fetch_array($result)){
$file=$row ['photourl'];
echo "</td><td align='center'>";
echo "<img src=\"thumbnail.php?thumb=$file\" alt=\"thumb\" />";
echo "</td><td align='center'>";
echo $row['description'];
echo "</td> <td align='center'>";
echo "<h4>" . $row['parish'] . "</h4>";
echo "</td><td align='center'>";
echo "<h4>" .$row['bedroom']. "</h4>";
echo "</td><td align='center' >";
echo "<h4>" .$row['bathroom'] . "</h4>";


echo "</td></tr>";
}
echo "</table>";


?>
0

hi There ,

Just a bit of formatting error in the php i guess . Below i have provided the corrected version of the code you included

&amp;amp;lt;div class="wrapper pad_bot3">
&amp;amp;lt;?php
echo " &amp;amp;lt;figure class="left marg_right1">&amp;amp;lt;img src=".$row['photourl']." alt="">&amp;amp;lt;/figure>";
echo " &amp;amp;lt;p class="pad_bot1">&amp;amp;lt;strong class="color2">."$row['parish']."&amp;amp;lt;/strong>&amp;amp;lt;/p>";
echo "&amp;amp;lt;p class="pad_bot1">&amp;amp;lt;strong class="color2">".$row['bedroom'],$row['bathroom']." &amp;amp;lt;br>";
echo " Price: &amp;amp;lt;span class="color1">".$row['status']." &amp;amp;lt;/span>&amp;amp;lt;/strong>&amp;amp;lt;/p>
&amp;amp;lt;a href="#" class="button">Read more&amp;amp;lt;/a>
?>
&amp;amp;lt;/div>

Hope this helps

Jude Dcoutho
www.rocketforward.net

Edited by jude.dcoutho

0

thanks for the qucik reply i tried it but got an error

Parse error: syntax error, unexpected '&' in on line

2

You have no php tags around your code and you are not using speach marks where needed, try this

<div class="wrapper pad_bot3">
<?php
echo '<figure class="left marg_right1"><img src="'.$row['photourl'].'" alt=""></figure>';
echo '<p class="pad_bot1"><strong class="color2">'.$row['parish'].'</strong></p>';
echo '<p class="pad_bot1"><strong class="color2">'.$row['bedroom'].','.$row['bathroom'].'<br>';
echo ' Price: <span class="color1">'.$row['status'].'</span></strong></p>';
?>
<a href="#" class="button">Read more</a>
</div>
0

sigh, figuered it out finally,came on to post but i am seeing your reply now did it exactly as u typed it thanks for the reply.

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.