473,394 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 1541
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 on "localhost" and it all works fine. My question...
4
by: dr. zoidberg | last post by:
Hello, I'm creating simple menu. MySQL: +----+-----+----------------------+ | id | sid | Title | +----+-----+----------------------+ | 1 | 0 | Main Menu 1 | 2 | 0 | Main Menu 2 | ...
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 about 200 records, and each record has five fields....
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 here. I installed on my Suse Linux system mysql 4.0...
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. fink.sf.net) - I am not sure, if this problem is caused...
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 not had any response (I'm pulling my hair out...
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> #include <mysql.h> #include <string.h> int main() {
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 NULL DROP PROCEDURE HumanResources.usp_My_Search;...
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 than go thru php, but since it's only about 80...
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 tag.tag_ID Indexes: Table 'tag': Keyname Type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.