0

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>
4

1 回答 1

0

将图像文件存储在磁盘上(大概在 Web 服务器上)并且只将它们的文件名存储在数据库的“封面”表中会更好吗?

很抱歉没有直接回答您的问题,但是在数据库中存储二进制文件的额外复杂性似乎并没有提供任何巨大的回报。

有关该主题的更多信息,请参阅此SO Post 。

于 2012-09-12T14:59:08.270 回答