It doesn't matter what the INSERT query I run is, every one I try behaves as expected if I run it directly from terminal in mysql or if $row[image] has a value. I've tried running a test using a very basic page and I get the same problem. The entire code for the page is as follows: <?php $conn = @mysql_connect('localhost', 'user', 'password'); if (!$conn) { echo '<p><b>error:</b> cannot connect to server</p>'; exit(); } if (!@mysql_select_db('database')) { exit('<p><b>error:</b> could not locate database</p>'); } mysql_query("INSERT INTO test VALUES ('2', 'my name')"); ?> <html> <body> <img src=""> </body> </html> If I use <img src="">, I get the insert entered twice. If I use <img src="asdf">, it works fine.