I am trying to add data to a database from a form
-
i know i have the connection right because i can do other things with it .. but when i add this text: sqlstr = "INSERT INTO `members` (`uname`, `pword`, `email`, `fname`, `lname`) VALUES ('request.Form("username")','request.For… 'request.Form("email")', 'request.Form("firstname")','request.For… " oConn.Execute sqlstr i get this error on the browser: Microsoft VBScript compilation error '800a0401' Expected end of statement /signupform.asp, line 22 sqlstr = "INSERT INTO `members` (`uname`, `pword`, `email`, `fname`, `lname`) VALUES ('request.Form("username")','request.For… 'request.Form("email")', 'request.Form("firstname")','request.For… " does anyone know what i'm doing wrong ? any help would be greatly appreciated
-
Answer:
The way you are building your sql statement is incorrect. Everything up VALUES looks ok, but then you need to do: VALUES (' " & request.Form("username") & " ' " & request.Form .. etc.
Student at Yahoo! Answers Visit the source
Related Q & A:
- How can I insert posted data into the database?Best solution by Stack Overflow
- How to display Android database data in a ListView?Best solution by Stack Overflow
- Why can't I add items to the database?Best solution by Stack Overflow
- How to show data in database with a JTable?Best solution by java-tips.org
- how to add a form with a unique id on jquery?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.