0

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>
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by xiiopao
1

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

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.