Array Error
//25 <input type=text name=prod>
String[] prod_detail=req.getParameterValues("prod");
if (prod_detail != null){
for (i=0;i<prod_detail.length;i++){
prod_detail=prod_detail;
}
}
for(i=0;i<prod_detail.length;i++){
stm.executeUpdate("insert into product(co_id,pro_name) values((select co_id from company where co_email='"+email+"'),'"+prod_detail+"')");
}
Problem:
If the user inserted into 3 input texts then it inserts into DB but also insert 22 blank text inputs into DB
plz check it and let me know the solution>
Please try again and this time use code formatting tags (select all the code you are posting and click the code button right above the text box).Your code is unreadable due to lack of code tags.
//25 <input type=text name=prod>
String[] prod_detail=req.getParameterValues("prod");
if (prod_detail != null){
for (i=0;i<prod_detail.length;i++){
prod_detail=prod_detail;
}
}
for(i=0;i<prod_detail.length;i++){
stm.executeUpdate("insert into product(co_id,pro_name) values((select co_id from company where co_email='"+email+"'),'"+prod_detail+"')");
}
Problem:
If the user inserted into 3 input texts then it inserts into DB but also insert 22 blank text inputs into DB
plz check it and let me know the solution>
No!What you did here was copy and paste your mangled code again without code tags. This is not your code. Post YOUR ORIGINAL CODE with CODE TAGS.Jeebus.
//25 <input type=text name=prod>
String[] prod_detail=req.getParameterValues("prod");
if (prod_detail != null){
for (i=0;i<prod_detail.length;i++){
prod_detail=prod_detail;
}
}
for(i=0;i<prod_detail.length;i++){
stm.executeUpdate("insert into product(co_id,pro_name) values((select co_id from company where co_email='"+email+"'),'"+prod_detail+"')");
}
Problem:
If the user inserted into 3 input texts then it inserts into DB but also insert 22 blank text inputs into DB
plz check it and let me know the solution>
please also check the DB insertion Command
for(i=0;i<prod_detail.length;i++){
stm.executeUpdate("insert into product(co_id,pro_name) values((select co_id from company where
co_email='"+email+"'),'"+prod_detail[i]+"')");
}
>
You're an idiot and I give up.
I know your ORIGINAL CODE has something like this for example
prod_detail[i] =
Because I can see where it went wonky without the code tags. I am really not interested, and I doubt anyone else will be either, in trying to reconstruct your code and put all the missing bits back.
> You're an idiot and I give up.
[b]
this is the 5th time that am posting and you didn't understand. now let me tell who is an idiot? Certainly you
and its better to not reply anybody and surely you have to give up
[/b]
> I know your ORIGINAL CODE has something like this for
> example [code]prod_detail =
You don't know anything Mr. Nothing
> Because I can see where it went wonky without the
> code tags. I am really not interested, and I doubt
> anyone else will be either, in trying to reconstruct
> your code and put all the missing bits back.
even I putted the code tag but you can never undertand that whats missing
You are an idiot. You keep posting code that you copy and paste from your first post that has the code mangled.It is too late to shove that into code tags.Please try and be less stupid.
Now rather than continuing to prove your ignorance might you please
consider posting your source code from your file (NOT THE CODE
POSTED IN YOUR FIRST POST) and use the code tags.
Then someone might be able to help you.
I cannot make it any clearer than this. You have till this point still not
posted your actual code.
> for (i=0;i<prod_detail.length;i++){
> prod_detail=prod_detail;
> }
> }
What are you trying to achieve with this code ?
Now it just assigns prod_detail to itself, it's useless.
> plz check it and let me know the solution
Use some debugger to find out what's wrong. Check the lenght of you'r array and how many times you execute that insert statement. Thus you will learn to solve problems yourself.