472,342 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,342 software developers and data experts.

Simple ASP MYSQL question

Hey

I have successfully been able to read from a MYSQL database using
this:

set rs = conn.Execute("SELECT Password FROM UserTable WHERE Username =
'" & entuser & "' AND Password = '" & entpass & "'")

Do while not rs.eof ' Do until it reaches end of db
actualpass = rs("Password")
rs.MoveNext ' Next record
loop
But I now want to be able to add new records to tables, I used this
code, but it does not seem to be able to work, any ideas?

set rs = conn.Execute("INSERT INTO UserTable SET Username = '" &
username & "' AND Password = '" & username & "' AND FirstName = '" &
username & "' AND LastName = '" & username & "' AND Email = '" &
username & "' AND confirm = 0 AND confstring = '" & passconf & "'")

Apr 30 '07 #1
1 1519
Lawrence wrote on 30 apr 2007 in microsoft.public.inetserver.asp.general:
set rs = conn.Execute("INSERT INTO UserTable SET Username = '" &
username & "' AND Password = '" & username & "' AND FirstName = '" &
username & "' AND LastName = '" & username & "' AND Email = '" &
username & "' AND confirm = 0 AND confstring = '" & passconf & "'")
I am not a mySql specialist, but the AND's seem faulty.

Try something like:

SQL="INSERT INTO UserTable (Password , FirstName , LastName )"&_
"VALUES ('" & pw & "','" & fn & "','" & ln & "')"
response.write SQL
response.end
' remark these 2 lines above when you are satisfied with the result
set rs = conn.Execute(SQL)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dariusz | last post by:
I am a beginner in PHP and MySQL, and am working through a book and various online tutorials on PHP and MySQL and now stuck - installed everything...
4
by: dr. zoidberg | last post by:
Hello, I'm creating simple menu. MySQL: +----+-----+----------------------+ | id | sid | Title | +----+-----+----------------------+ | 1...
4
by: Laurel Thomason | last post by:
Hi, I'm looking for a simple, web-enabled php database that I can customize. It doesn't even have to use mysql. It's just gotta be able to hold...
0
by: MJL | last post by:
This is a mysql/php question (but a little more on the mysql side.) The two are so closely related these days, I thought it would be ok to ask...
0
by: Andreas Reuleaux | last post by:
What works for me with mysql 3.23.49 of Debian GNU/Linux (Woody), does not any more with mysql 3.23.56 of fink (current-stable, for fink cf....
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have...
4
by: yogesh | last post by:
mysql in c++ initialize error occurs a simple program is executed in redhat9.0 , using gcc 3.2.2 compiler version ... #include <stdio.h>...
1
by: Ted | last post by:
In MS SQL I used the following to create a stored procedure. USE AdventureWorks; GO IF OBJECT_ID ( 'HumanResources.usp_My_Search', 'P' ) IS NOT...
27
by: gerrymcc | last post by:
Hello, I'm a php/mysql beginner... Is there any way of making the mysql command line client full-screen? Sometimes it's easier to use the client...
0
by: stacionari | last post by:
HI, My query is like this: SELECT tag.* FROM tag LEFT JOIN book_item ON tag.Tag_ID = book_item.BookItem_ID WHERE tag.Tag = "tags" GROUP BY...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.