does anyone here know how to insert form contents accomplished by a user to a database.., i have a code but it doesnt seem to work.. :confused:...

here's my code ... it's in jstl but if there is a easier alternative then just spill it out

<sql:update dataSource="${orders}" var="updatedTable" >
   INSERT INTO orders(id,name,address,phone,custorder) VALUES (?, ?, ?, ?, ?)
                <sql:param value="${NULL}" />
                <sql:param value="${param.name}" />
                <sql:param value="${param.address}" />
                <sql:param value="${param.phone}" />
                <sql:param value="${param.orders}" />
                </sql:update>

Recommended Answers

All 2 Replies

Would have been nice if you posted/explained what is actual problem or error message and not just generic request.
Since we do not know how you created table we can guess that you either declared "id" value to be sequence/auto increment in which case providing NULL value is OK, but it is not necessary. If "id" is not sequence then error is obvious as id is NULL.
For few tips on sql:update you can check this article

i got it!!! thanks for the reply it surely helped... ive been thinking about this for the last 3 days .., xD thanks again =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.