![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Sep 2004
Location: Cyprus
Posts: 147
Rep Power: 5
![]() |
Displaying images
This is the code, not sure why its not working, I defined
$img = "<img src="images/">; print"<td width=48 bgcolor=#EEEEEE height=22 align=left height=22 class=style5>$img$imgpath</td>"; Complete File: <?
$query = "SELECT ID, countryname, currency, imgpath FROM countries order by ID";
$result = mysql_query($query);
$num_rows = mysql_num_rows( $result );
$img = "<img src="images/">;
while($row = mysql_fetch_array($result))
{
$ID = $row["ID"];
$countryname = $row["countryname"];
$currency = $row["currency"];
$imgpath = $row["imgpath"];
print"<tr>";
print"<td width=48 bgcolor=#EEEEEE height=22 align=left height=22 class=style5>$ID</td>";
print"<td width=48 bgcolor=#EEEEEE height=22 align=left height=22 class=style5>$countryname</td>";
print"<td width=48 bgcolor=#EEEEEE height=22 align=left height=22 class=style5>$currency</td>";
print"<td width=48 bgcolor=#EEEEEE height=22 align=left height=22 class=style5>$img$imgpath</td>";
print"<td width=48 bgcolor=#EEEEEE align=center height=22 align=left height=22 class=style5><div align=center >Edit</div></td>";
print"<td width=48 bgcolor=#EEEEEE align=center height=22 align=left height=22 class=style5><div align=center ><input type=checkbox name=cb[] value=ID></div></td>";
print"</tr>";
}
?>
__________________
Personal Portfolio TecBrain Support Forum Linux VS Windows ... Dont Even Think of it .. Distribution: Slackware if (OS==Linux) return success There are 10 kinds of people, those who can read binary numbers and those who can't. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
View your source code in the browser where you think you have a nice valid image path and specification. Then investigate concatenation.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 | |
|
Hobbyist Programmer
Join Date: Sep 2004
Location: Cyprus
Posts: 147
Rep Power: 5
![]() |
Quote:
__________________
Personal Portfolio TecBrain Support Forum Linux VS Windows ... Dont Even Think of it .. Distribution: Slackware if (OS==Linux) return success There are 10 kinds of people, those who can read binary numbers and those who can't. |
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Well, I think it would have stuck better if you had peeped at it, but consider this:
Print these adjacent to each other: $img$imgpath you get this: <img src="images/"> up against whatever was in the DB. Probably something like this: <img src="images/">myImage.jpg. Don't think that's what you're going to want.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Sep 2004
Location: Cyprus
Posts: 147
Rep Power: 5
![]() |
__________________
Personal Portfolio TecBrain Support Forum Linux VS Windows ... Dont Even Think of it .. Distribution: Slackware if (OS==Linux) return success There are 10 kinds of people, those who can read binary numbers and those who can't. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|