finncr4 Posted April 17, 2003 Posted April 17, 2003 I'm having trouble inserting into my database from my php page. I can connect to the db and select from the db. I've tried deleting the table and creating it again. Nothing is working. Please help. Quote
tastewar Posted April 17, 2003 Posted April 17, 2003 Can you show what your script is doing? Can you tell us what the error is? I'm not a SQL expert, so I can't help, but I doubt anyone can with the info you've given... Quote
mastaflex Posted April 17, 2003 Posted April 17, 2003 This is how i do it. connecting to database. >$db = mysql_connect(localhost, $db_username, $db_password); mysql_select_db($db_name); then to insert >$sql = "INSERT INTO tablename (value1,value2,value3) VALUES ('$var1','$var2','$var3')"; $result = mysql_query($sql); Quote
chuckmalani Posted April 18, 2003 Posted April 18, 2003 put your php and sql statements in here along w/ any errors you are getting... chuck Quote
dombrorj Posted April 21, 2003 Posted April 21, 2003 I have a similar question. I created a table, and I want to some information from a form to be added to the db on submitt. What would I have to have in my php file to do this. Can someone spell out for me how to insert to mysql db via a php file. The info that will be inserted is simply a visitors name and email that they insert and submit in my form. Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.