title: python CGI and JQUERY problem
body: <p>I have a simple python CGI script where I query a MySQL database and then prints the result to the screen/webpage.
  My problem is that the "cursor.execute()" function returns a list of tuples. I use a simple for loop to iterate through this list and extract each tuple. This was working great until.....I got the bright idea to use jquery to make some eyecandy for the user. My whole script still work....except the for loop. </p>
  
  <p>I have tried to (to my mind) everything, but for some reason when I do a loop it breaks everything. Could someone enlighten me please. I have also noticed that if I try and seperate my HTML formatting and python code by using function calls this also breaks the whole thing. By breaking I mean I get a server error(apache)</p>
  
  <p>Below is the error via /var/log/httpd/error.log:</p>
  
  <pre><code>[Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32]  , referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32]  , referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32]  , referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32]  , referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32] ^, referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32] SyntaxError, referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32] : , referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32] invalid syntax, referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32] , referer: http://test/index-test.html
  [Tue Jan 12 14:56:25 2010] [error] [client 192.168.7.32] Premature end of script headers: userdata_submit.py, referer: http://test/index-test.html
  </code></pre>