If <code>intreqID1</code> is a number you don't need the apostrophes around it. Can you insert a line into your program that prints out the SQL statement you're trying to execute ? I want to know whether the correct value is being inserted for <code>intreqID1</code> . Also can you execute <code>SELECT COUNT(*) FROM RequestTable WHERE ID='1-HS'</code> ?