Forum Moderators: coopster
I am used to ASP and SQL Server, and typically, I use a request.form(fieldname) to get the form contents, then I will insert it into my SQL statement...
But how on earth do you get form values in PHP to be put into a mySQL database.
It would be ideal if there were a script out there, written in PHP that collects all the form data and puts it into a nice SQL string for insertion... Assuming of course that the field names in the form are the same as the column names in the table.
Any chance I'd get lucky on this one?
Thanks if so~
~ Speedster
Say you had form fields called 'foo', 'bar' and 'baz' that you wanted to insert into a table 'widgets' with columns 'one', 'two' and 'three', your PHP would look something like:
$query="INSERT INTO widgets (one, two, three) VALUES ('$foo', '$bar', '$baz')";
mysql_query($query, $mysql_link);
Hope this helps
Again, much thanks.
~ Speedster