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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ABOUT MYSQL AND PHP how to make input..

Status
Not open for further replies.

newbie3

Programmer
Jan 26, 2005
5
US
how do i input into mysql... assume that all required fields and table are created.
eg:
<html>
<body>
<form method=&quot;post&quot; action=&quot;test.php&quot;>
title : <input type=&quot;radio&quot; value=&quot;V1&quot; name=&quot;R1Mr
<input type=&quot;radio&quot; value=&quot;V1&quot; name=&quot;R1>Mrs
Name : <input type=text name=&quot;firstname&quot; size =20><p>
Number: <select size=&quot;1&quot; name=&quot;D6&quot;>
<option>012</option>
<option>019</option>
<option>013</option>
<option>016</option>
<option>017</option>
</select>
<input type=submit value=&quot;submit&quot;>
</form>
</body>
</html>

thanks.. i hope u can write here php scripts
 
hi newbie.

$SQL = &quot;INSERT INTO $mytable
(r1,firstname,d6) VALUES
('$r1','$firstname','$d6')&quot;;
mysql_query($SLQ,$dbh);


form names (ie. firstname) become variables within
php scripts and hold values of the forms.

check out php.net (docs) for more info.
This is a assum'n you have proper mysqlserver setup
(ie. user permissions etc..)

cheers
Ken [sig]<p>Ken<br><a href=mailto:admin@mysqlwebring.com>admin@mysqlwebring.com</a><br><a href= Webring</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top