Question

I just came across with this project where I had to display some images in the back-end of a website for that I have used Classic Asp and SQL Server 2000, so far I can display most of the things from the database. I can't figure out about this image thing. I tried what I could understand so far I created a table in which there a img column with image data-type I don't know if its right. How should I go around scripting to fetch images.

<table border="1" cellpadding="0" cellspacing="0" width="100%">
                <tr height="25px">
                    <th width="25%">Cover Name</th>
                    <th width="25%">Category Name</th>
                    <th width="17%">Thumbs</th>
                    <th width="17%">&nbsp;</th>
                    <th width="17%">&nbsp;</th>
                </tr>
                <%
                    sql = "SELECT * from covers"
                    rs.open sql, con, 1, 2
                    do while not rs.eof
                %>
                <tr>
                    <td align="center"><%=rs("c_name")%></td>
                    <td align="center"><%=rs("category")%></td>
                    <td align="center"><%=rs("img")%></td>
                    <td align="center"><a href="edit.asp?cover=<%=rs("c_name")%>">Edit</a></td>
                    <td align="center"><a href="delete.asp?cover=<%=rs("c_name")%>" onclick="var r =confirm('This Cover details will be deleted permenantly . Are you sure you want to DELETE');
                {
                    if (r==true)
                    alert('record will be deleted');
                    if (r==false)
                    return false;
                }">Delete Info</a></td>
                </tr>
                <%
                    rs.movenext
                    loop
                    rs.close
                %>
                </table>

No correct solution

OTHER TIPS

Would it be better to store the image files on disk (presumably on the web server) and to only store their filenames in the 'cover' table in the database?

Apologies for not directly answering your question, but the extra complication of storing binary files in a database doesn't really seem to offer any great advantages in return.

See this SO Post for much more information on the subject.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top