prcollin Posted July 16, 2007 Share Posted July 16, 2007 Is it easy to create an HTML form that connects to a database through a data handling form. I have php 4.4 on my server and wrote all my scripts in 5.0 language and they dont run so i just wanna use an HTML form to submit to a database and to retrieve info from it. Any help would be appreciated Quote Link to comment Share on other sites More sharing options...
tapos Posted July 16, 2007 Share Posted July 16, 2007 use www.google.com -- Tapos Pal Quote Link to comment Share on other sites More sharing options...
arsl1006 Posted July 16, 2007 Share Posted July 16, 2007 Im new to this too (so please ignore this if im teaching you how to 'suck eggs'), but i think i can help: I'm working with PHP and MySQL and have <?PHP mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("database name") or die(mysql_error()); echo "<p>Successful connection to database</p>"; $strString = "INSERT INTO tablename(`fieldname`, `fieldname`) VALUES (`$value1box`,`$value2box`)"; $result = mysql_query($strString) or die(mysql_error()); echo "Results stored in database:"; $strQuery2="SELECT `fieldname1` , `fieldname2` FROM `tablename`"; $result = mysql_query($strQuery2) or die(mysql_error()); echo "<table border='2'>"; echo "<tr><th>fieldname1</th><th>fieldname2</th></tr>"; while($row = mysql_fetch_array( $result )) { echo "<tr><td>"; echo $row['fieldname1']; echo "</td><td>"; echo $row['fieldname2']; echo "</td></tr>"; } echo "</table></body></html>"; ?> <HTML><BODY> <form action="<?php $_PHP_SELF ?>" method="POST"> <input type="text" name="value1box" value="ENTER VALUE 1"> <input type="text" name="value2box" value="ENTER VALUE 2"> </form></body></html> .... I think ) Quote Link to comment Share on other sites More sharing options...
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.