Jump to content

inine

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by inine

  1. Heya. I was wondering if there is any way to force each echo into a separate box or something to prevent them from overlapping with other posts from earlier, currently when i echo text + images from the database the images and everything works as intended. The problem comes up when there is maybe a line or two of text witch causes the images to spill over onto earlier echos, it started when i aligned image to the right of the text. The code i use for echo looks like this. <?php require_once 'nconfig.php'; $data = mysql_query("SELECT * FROM etusivu order by `id` DESC ") or die(mysql_error()); while($info = mysql_fetch_array( $data )) {echo "<b>".$info['otsikko'] . "</b><br> "; echo "".$info['teksti'] . " <br>"; $file = $info['photo_name'];echo '<div align="justify" id="container"> <div id="thumbnail"><a href="etuploads/'. $file .'" title="'.'"><img src="etuthumbs/etuthumb_'.$info['id'].'.jpeg" width="282" height="158" alt="image" align="right" /></a></div> <div id="info"></strong>' .'</div> </div><br>';echo "<b>Date:</b> ".$info['date_added'] . "<br>";echo "<a href="delete.php?id=" .$info['id'] ."">delete</a>";echo '<br/><hr/>';}?> So i would be happy if someone could be able to help me come up with a solution, seeing i have been stuck on this problem for a while.
  2. Greetings, i am relatively new to programming , i have been trying to create a index page for a website that would echo for me title, the text relative to it + date and time when it was posted, everything worked fine, but then i decided i wanted to include images as thumbnails as a option. I started with reworking a gallery code i had that worked great it uploaded and created thumbnails that were put in two different folders uploads and thumbnails, the thumbnail is same as ID of the post while it gets the info for the larger image from the table:photo_name in database. Database is set up currently 1:ID int(30) Primary 2:photo_name varchar(200) 3 title varchar(250) 4: text(longtext) 5:date_added (datetime) I managed to strip the gallery code of most of its features so it would only display the image and nothing else, so now that i removed a bunch of stuff and combined the image with my other echos it will bring every single thumbnail that is in database instead of only the one that is under a ID that includes all the text. This is the code i use to retrieve the images from the database, i tried to figure out a better way to display thumbnails other than to strip down a gallery code, but seeing i am new to this i ended up getting stuck. $sql = "SELECT * FROM photos ORDER BY `id` DESC";$query = mysql_query($sql);while($row = mysql_fetch_array($query)){ $file = $row['photo_name']; echo '<div id="container"> <div id="thumbnail"><a href="uploads/'. $file .'" title="'.'" class="thickbox"><img src="thumbnails/thumb_'.$row['id'].'.jpeg" width="282" height="158" alt="image" /></a></div> <div id="info"><strong>' .'</div> </div>';}
×
×
  • Create New...