• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to handle MYSQL  RSS feed

 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to update a database with inserting form inputs?
I try this code,

<sql:update dataSource="${snapshot}" var="result">
INSERT INTO Student VALUES ('$_GET[firstname]','$_GET[lastname]','$_GET[age]');
</sql:update>

but its not work.
can anyone help me?
 
Rob Spoor
Sheriff
Posts: 21117
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless. What does it do instead? Do you get an error?
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code inside the <sql:update> tag is not really Java, as I see something like:

$_GET[firstname]

it looks like PHP code.
 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. but how get the value of text box for database?

 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
skevin scott wrote:ok. but how get the value of text box for database?



You can use EL expression, for example:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!