Jump to content

[SOLVED] get pic


justAnoob

Recommended Posts

The following works great and display properly except for the part in the table where I want a letter to appear. The letter is just saved in my images folder on my server. The letter will eventually get a link, but I'm not worried about that right now. look below at the commented sections for what my problem is.

<?php
echo "<tr><td>";
echo '<img src="' . $row['imgpath'] . '" width="125" alt="" />';  //works good
echo "</td><td>";
echo $row['student'];                                                      //good
echo "</td><td>";
echo $row['description'];                                                      //good
echo "</td><td>";
echo $row['in_return'];                                                     //good
echo "</td></td>";
echo '<img src="images/K_little.png">';           //the picture appears,, but not in table format like the rest of
echo "</td></tr>";                                     //rows from mysql. All the info is in mysql, except for the K_little
}                                                             
echo "</table>";
?>

Will this be a problem getting the K_little to appear on the page in the format I would like. Right now the K_little echos above the table and not inside it like the data from mysql. The table will keep displaying students until no more are in the system. So the letter K_little.png picture needs to be displayed in the letter column of the table for each student,,,, Understand???

------------------------------------------|

|student    description    in return    letter

|         

| xxxxx        xxxxx            xxxx          k

|

|  xxxx        xxxxx            xxxxx        k

|

| xxxxx        xxxxx            xxxxx        k

 

Link to comment
https://forums.phpfreaks.com/topic/152564-solved-get-pic/
Share on other sites

Try this:

<?php
echo "<tr><td>";
echo '<img src="' . $row['imgpath'] . '" width="125" alt="" />';  //works good
echo "</td><td>";
echo $row['student'];                                                      //good
echo "</td><td>";
echo $row['description'];                                                      //good
echo "</td><td>";
echo $row['in_return'];                                                     //good
echo "</td></td>";
echo "<img src=\"images/K_little.png\">";           //the picture appears,, but not in table format like the rest of
echo "</td></tr>";                                     //rows from mysql. All the info is in mysql, except for the K_little
}                                                             
echo "</table>";
?>

The backslashes make PHP ignore them as syntax, just output them.

Link to comment
https://forums.phpfreaks.com/topic/152564-solved-get-pic/#findComment-801291
Share on other sites

K_little.png is just a picture on the server that I want to display, it does not have a image path in mysql. It is this line of code that I want it to display in. I can get it to display, but not in the format that I want. Here is what is does now.

<?php
echo "<img src=\"images/K_little.png\">";           
?>

K

K

K

column 1    column 2    column 3  column 4

 

    xx              xx            xx           

    xx              xx            xx

    xx              xx            xx

 

 

this is how I would like it to be

column 1    column 2    column 3  column 4

 

    xx              xx            xx            K

    xx              xx            xx            K

    xx              xx            xx            K

 

Link to comment
https://forums.phpfreaks.com/topic/152564-solved-get-pic/#findComment-801521
Share on other sites

...
echo $row['in_return'];                                                     //good
echo "</td></td>";
echo "<img src=\"images/K_little.png\">";
...

Closing 2 td instead of closing then opening a td

 

Use :

...
echo "</td><td>";
...

 

Next time try validate your html code before posting into a forums for help :

http://validator.w3.org/

That kind of error is easly found by the validator

Link to comment
https://forums.phpfreaks.com/topic/152564-solved-get-pic/#findComment-801527
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.