Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

Inputing Data into MYSQL - Am I doing this right?

$
0
0

So I built a website a few years ago when I was first learning coldfusion, I allowed users to register, it has worked fine for my needs but I am getting ready to build another site and am wondering if my Data Insert into MYSQL is correct for the times...

 

Here is my code for my current solution, I guess my main question is, after a user clicks "Submit" is this the best way to insert data into my database?

 

<cfquery name="peopleregister" datasource="sitedata">
     INSERT INTO users (registrationdate, namefirst, namelast, fullname, UserPassword, email, streetaddress, addressline2, city, state, zipcode, country, phonenumber)

     VALUES (#CreateODBCDateTime(Now())#, '#REReplace(titleCase(Trim(Form.namefirst)), "[^0-9a-zA-Z_]", "", "ALL")#', '#REReplace(titleCase(Trim(Form.namelast)), "[^0-9a-zA-Z_]", "", "ALL")#', '#REReplace(titleCase(Trim(Form.namefirst)), "[^0-9a-zA-Z_]", "", "ALL")# #REReplace(titleCase(Trim(Form.namelast)), "[^0-9a-zA-Z_]", "", "ALL")#','#Form.UserPassword#', '#LCase(Trim(Form.email))#', '#Form.streetaddress#', '#Form.addressline2#', '#Form.city#', '#REReplace(UCase(Form.state), "[^0-9a-zA-Z_]", "", "ALL")#', '#Form.zipcode#', '#Form.country#', '#Form.phonenumber#')
</cfquery>


Viewing all articles
Browse latest Browse all 14291

Trending Articles