Page 1 of 1

Insert image into php table

Posted: Sun Aug 23, 2009 10:42 am
by synical21
Pretty simple problem but im unable to find an answer which doesnt involve me uploading the image to the MySQL database. Basically i have a php table like this:

Code: Select all

echo "<tr>";
        echo "<td align='center'><font color='#006600'>$user_id </font></td>\n";
        echo "<td align='center'><font color='#006600'> $job_id </font></td>\n";
        echo "<td align='left'> $info </td>\n";
                echo "<td><img src ="images/tick.png"></td>\n"; <<<<<<<<<<<<<<<<< image here
i have fiddled with the line alot but still cant get it to work, I just need the image in that column on the table so that when the user clicks the image they are redirected to a new page.

Is there a way to do this but with the image on the webserver?

Re: Insert image into php table

Posted: Sun Aug 23, 2009 11:30 am
by John Cartwright
I just need the image in that column on the table so that when the user clicks the image they are redirected to a new page.
If I understand you correctly, wrap your <img /> tag in <a></a> tags, I,e.

Code: Select all

<a href="http://yourlink.com"><img src ="images/tick.png"></a>

Re: Insert image into php table

Posted: Sun Aug 23, 2009 11:49 am
by synical21

Code: Select all

 echo "<tr>";
        echo "<td align='center'><font color='#006600'>$user_id </font></td>\n";
        echo "<td align='center'><font color='#006600'> $job_id </font></td>\n";
        echo "<td align='left'> $proof </td>\n";
        echo "<td><a href="link.php"><img src ="images/tick.png"></a></td>\n";
    } // END WHILE ITERATOR
    echo "</table>\n";
Still no luck the page just doesnt display anything, that is my problem. If i take out the image line the page works fine. I must be doing something wrong in that line but i dont know what.