<div>Hi;</div>
<div>Gabriel provided a lovely script for showing images which I am modifying for my needs. I have the following line:</div>
<div> </div>
<div>print '<img src="getpic.py?id=%d&x=%d"><br /><br /></td>\n' % (d, y)<br></div>
<div>where the correct values are entered for the variables, and those values increment (already tested). Here is the slightly modified script it calls:</div>
<div> </div>
<div> </div>
<div>#!/usr/local/bin/python<br>import cgitb; cgitb.enable()<br>import MySQLdb<br>import cgi<br>form = cgi.FieldStorage()<br>picid = int(form["id"].value)<br>x = int(form["x"].value)<br>pic = str(x)<br>
print 'Content-Type: text/html'<br>db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=db)<br>cursor= db.cursor()<br>sql = "select " + pic + " from products where id='" + str(picid) + "';"<br>
cursor.execute(sql)<br>content = cursor.fetchall()[0][0].tostring()<br>cursor.close()<br>print 'Content-Type: image/jpeg\r\nContent-Length: %s\n' % len(content)<br>print content<br></div>
<div> </div>
<div>I need to make it so that it will show all my images, not just the last one. Suggestions, please.</div>
<div>TIA,</div>
<div>Victor</div>