Welcome Guest, Not a member yet? Register   Sign In
Best method to save $_POST data to a database
#2

[eluser]dmorin[/eluser]
Sending $_POST info directly to the database is generally a bad idea, especially if you're not using the active record class in which case there won't be any escaping of the information.

I'm not sure about the script you're talking about, but if you have your form fields named identically to the field names in your table, you should be able to pass the $_POST array directly to the insert active record function, but this still has a lot of problems. I would say, use the validation class, make sure the data you're getting is accurate and sanitized, and then pass the fields you need to the active record class.

Good luck. If you have a specific situation, let us know.


Messages In This Thread
Best method to save $_POST data to a database - by El Forum - 03-01-2008, 09:24 PM
Best method to save $_POST data to a database - by El Forum - 03-01-2008, 10:10 PM
Best method to save $_POST data to a database - by El Forum - 03-01-2008, 10:19 PM
Best method to save $_POST data to a database - by El Forum - 03-02-2008, 04:56 AM
Best method to save $_POST data to a database - by El Forum - 03-03-2008, 07:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB