| | |
Showing image
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 89
Reputation:
Solved Threads: 0
I have created a database. It just contains information about websites. One column has the path to an image, like a rating system(1-5 stars). I just need to display this information on a web page. Everything shows up fine, but I just need it to display the image instead of the path to it.
Any help would be greatly appreciated!
php Syntax (Toggle Plain Text)
<?php $row_count = 0; $columns = 3; while ($row = mysql_fetch_assoc($result)) { if ($row_count == $columns) { echo "</tr><tr>"; $row_count = 0; } echo "<tr><td>"; echo $row['Site']; echo "</td><td>"; echo $row['Description']; echo "</td><td>"; echo $row['Rating']; echo "</td>"; $row_count++; } ?>
•
•
Join Date: May 2008
Posts: 97
Reputation:
Solved Threads: 16
php Syntax (Toggle Plain Text)
<?php $row_count = 0; $columns = 3; while ($row = mysql_fetch_assoc($result)) { if ($row_count == $columns) { echo "</tr><tr>"; $row_count = 0; } echo "<tr><td>"; echo $row['Site']; echo "</td><td>"; echo $row['Description']; echo "</td><td>"; echo "<img src=\"{$row['Rating']}\" alt=\"{$row['Description']}\" />"; echo "</td>"; $row_count++; } ?>
Last edited by sureronald; Jul 28th, 2009 at 4:57 am. Reason: code errors
![]() |
Similar Threads
- how to retrive image file from mysql databse using php (PHP)
- Website NOT showing menu hover in Internet Explorer (Site Layout and Usability)
- showing image on crystal report (VB.NET)
- showing image by click button (Python)
- Hover Image Position ??? (HTML and CSS)
- thx but how do i display an image in java (Java)
Other Threads in the PHP Forum
- Previous Thread: value in third text box
- Next Thread: Session gabbage cleaner
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code confirm cron curl customizableitems database date directory display download dynamic echo email error external file files folder form forms forum function functions google headmethod href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query question radio random recursion regex remote script search select server sessions shopping sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube





