Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

info to the database with php

Status
Not open for further replies.

thumbelina

Programmer
Jun 4, 2001
58
CA
ok i have a form on the website and i want to contents of the form to be saved into the mysql database. the form i'm working with now is just one text box into one field but it's not working quite right, anyone have anythoughts?<form name=&quot;newproject&quot; action=&quot;<?php echo $PHP_self?>&quot;>

<?php $crap = mysql_connect(&quot;localhost&quot;,&quot;username&quot;,&quot;passw&quot;);
mysql_select_db(&quot;database&quot;,$crap);
$sql = &quot;INSERT INTO ProjectList (entryID, projectname) VALUES (null, '$projectname')&quot;;
$result = mysql_query($sql);?>

when i hit the submit button it enters a blank reord and then the info i typed the second time i press it. also if i try to enter a second value it enters the first one again, and then the new value. thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top