Jump to content

fueston

Members
  • Posts

    4
  • Joined

  • Last visited

fueston's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. This definately works. when I run this I get the whole database listed out. I am wondering if my problem has to do with the fields I am inserting. I have the list of fields in order with their values , but some of the fields in the database are not on the form and so are not listed in the insert statement. As long as I list the column list in correct order and with the correct name and corresponding values, do I need to list the fields not showing on the form in their appropriate order with values 'null' in the insert statement? In other words...form shows:nameaddresszipsame fields in our database are:member id (auto increment)name addresszipdonationwould the insert statement read:insert into membership (null, name, address, zip, null)values ('null ','$_POST[name]','$_Post[address]','$_Post[zip]', 'null')"; The auto increment field obviously does not show up on the form, nor does the donation field. Would they have to show up as 'null' on the insert statement?Thanks again for all your help.kf
  2. Took your suggestion but no luck unfortunately. I dont think it is connecting so I am trying to come up with a test connection file. I tried this:<?php$con = mysql_connect("localhost","humane","password") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_close($con);?> When I run this little test file, I get a blank page in response.kf
  3. Thank you for the suggestion.Tried putting this into my insert.php file and the webpage just flashes at me so I tried putting this line in a file named connecttest.php. When I run the file I get a blank page as a response. Should I add anything to the test file to make it respond with the error message?This is what my test page looks like:<?php$con = mysql_connect("localhost","humane","password") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_close($con);?> Unfortunately the page the script was on has been changed a couple of times and I am not sure when I broke it. Stupidly, I did not test it as thoroughly as I should have along the way. Tried to put it back as close as I could back in June with the saved files I kept but no luck.
  4. I have made a simple website for our local humane society and wish to include an html form which will feed the information into our mysql database.I am sure I had this working at one time, but in changing the html of the page somehow I have broken it and for the life of me I cannot seem to fix it. It will not put the data into the database.Here is the code from the html page (www.siskiyouhumane.org/webmemberform5.php)<form><form action="insert.php" method="post">Today's date (YYYY-MM-DD):<INPUT TYPE="text" NAME="date_entered" /><br />Last Name:<INPUT TYPE="text" NAME="last_name" /><br />First Name:<INPUT TYPE="text" NAME="first_name" /> <br /> Address:<INPUT TYPE="text" NAME="address" /> <br /> Town:<INPUT TYPE="text" NAME="town" /> <br />State (XX):<INPUT TYPE="text" NAME="state" /> <br /> Zip:<INPUT TYPE="text" NAME="zip" /> <br /> Phone (xxx xxx-xxxx) :<INPUT TYPE="text" NAME="phone" /><br />Email:<INPUT TYPE="text" NAME="email" /><br /> Do you have a special talent?:<INPUT TYPE="text" NAME="skills" /> <br /><INPUT TYPE="submit" value="Join now!" /></FORM></body></html>Here is the code from the insert file - the account name and database name are the same. The data table is called membership.<?php$con = mysql_connect("localhost","humane","password");if (!$con)mysql_select_db("humane", $con);$sql="INSERT INTO membership (date_entered, last_name, first_name, address, town, state, zip, phone, email, skills)VALUES('$_Post[date_entered]','$_POST[last_name]','$_POST[first_name]','$_Post[address]','$_Post[town]','$_Post[state]','$_Post[zip]','$_Post[phone]','$_Post','$_Post[skills]')";print "<p>Thank you for joining the Siskiyou Humane Society<p>";mysql_close($con);?> I hate to bother you very busy people, but I would greatly appreciate if anyone could see my mistake. I have spent hours trying to get this to work, looking at various sites and scripts. no luck.Thanks so much.Kathy Fueston
×
×
  • Create New...