Quote:
Originally Posted by tangoforce
As I asked you earlier, did you restructure the database (obviously no) and did you change the contents from the file itself to the filename and path instead? - Clearly this looks like no too.
You posted another topic today. In that code you were putting the actual file inside the database. Since then you've decided to use the filename / path.
When you change your mind and decide to use the filename instead of the file stream, you must delete the old files that are stored in the database and change the column from a blob to a text field instead.
I suspect the reason none of your images are showing is because instead of printing a file name and path in your html, you're trying to print a filestream instead.
|
Sorry i am kind of new to this.
i changed the type to varchar with a length of 255 characters but till no image.
this is what i have for my output code now
PHP Code:
<?php
$per_page = 4;
$pages_query = mysql_query("SELECT COUNT(id) FROM testimonial")or die(mysql_error());
$pages = ceil(mysql_result($pages_query, 0) / $per_page);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$query = mysql_query("SELECT id, name, comment, picture FROM testimonial LIMIT $start, $per_page") or die(mysql_error());
$count=mysql_num_rows($query);
$count=1;
while ($query_row = mysql_fetch_array($query)){
$pic=$query_row['picture'];
?>
<?php if($count==1){ ?>
<div class="testmon_box">
<?php } ?>
<?php if($count<=1){ ?>
<div class="TESMON_INNERBOX">
<div class="pic_block">
<?php if($pic !=""){?>
<img src="<?php echo $pic; ?>" />
<?php } else{?><img src="<?php bloginfo('template_url'); ?>/images/pic_02.jpg" /><?php } ?>
</div>
<div class="test_cont_block">
<p> <?php echo $result=$query_row['comment']; ?></p>
<span class="danam">
Date of Posting: <?php echo date('l, F j, Y'); ?><br/>
<strong>Posted by: <?php echo $result=$query_row['name']; ?></strong>
</span>
</div>
<div class="clear"> </div>
</div>
</div>
<?php } ?>
<?php } ?>
<div class="pagin_nav">
<?php if ($pages >=1 && $page <= $pages){
for ($x=1; $x<=$pages; $x++){
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></srtong> ' : '<a href="?page='.$x.'">'.$x.'</a> ';
}
}?>