brandonjbegle 0 Report post Posted March 29, 2009 Can someone tell me how to send data from a form to an sql database.the inputs arelink_urllink_namelink_descriptionIf you can write what this should look like, including the html form, it would really be appreciated Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted March 29, 2009 Open the Database Connection and Select the database you wish to use // Make the connnection.$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );// Select the database.@mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );Assume the Form has been POSTed, validate the POST values into regular variables and the INSERT them into the database.// Make the query.$query = "INSERT INTO users (first_name, last_name, email, password, registration_date) VALUES ('$fn', '$ln', '$e', SHA('$p'), NOW() )";Now Close the databasemysql_close(); // Close the database connection. Share this post Link to post Share on other sites
brandonjbegle 0 Report post Posted March 29, 2009 (edited) I'm sorry but i'm totally new to this so can you give me the specific code for my situation stated above?*Edit* I found an automatic generator so i no longer need help. Thanks anyway! Edited March 30, 2009 by brandonjbegle (see edit history) Share this post Link to post Share on other sites