Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update jsp mysql

Status
Not open for further replies.

sensory21

Programmer
Jan 27, 2004
79
GB
Hi all,

I am trying to update (after editing) some displayed records in a form, the file compiles ok, no message error but the update doesn't take place?

String sql1 = "UPDATE provider set company_name='" + company_name + "', contact_name='" + contact_name + "', address='" + address + "', address2='" + address2 + "', city='" + city + "', pcode='" + pcode + "', country='" + country + "', phone='" + phone + "', fax='" + fax + "', email='" + email + "', website='" + website + "', account_no='" + account_no + "', reference='" + reference + "' where provider_id=" + val;
out.print(sql1 + &quot;<br>&quot;);
st.executeUpdate(sql1);


<input type=&quot;text&quot; size=&quot;40&quot; class=&quot;text-box&quot; name=&quot;company_name&quot; value=&quot;<%= company_name %>&quot;>

Cheers
Vero
 
Hi,

Can you copy the output of sql1 and run it from the MySQL command prompt ?

If not copy and paste the out put of sql1.

Cheers,
Venu
 
Yes, I've just done that and the record has updated without problem, in the cmd I added contact_name='vero' and that was fine!
This is the output of sql1

UPDATE provider set company_name='Edgars Cool Water', contact_name='', address='New Wharf', address2='Brighton Road', city='Shoreham-by-Sea - West Sussex', pcode='BN43 6RN', country='UK', phone='01273 701618', fax='01273 888338', email='', website=' account_no='SENS0004', reference='' where provider_id=132

vero
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top