English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have created a database using phpMyAdmin, the trouble is using a registration page to put information in the database, could someone with php/mysql knowledge please tell me how you would use a form to put information in a database? Thanks.

2007-03-08 20:28:27 · 4 answers · asked by DM 1 in Computers & Internet Programming & Design

4 answers

I use excel and it's quite straight forward. You just need to move your arrow onto a box and click it and then start typing.

I know a lot of people use them for mathematical things but I've got no idea how they make it add all the numbers up - so at the moment I just like use my calculator and type it in manually.

The problem with this method is that I always have to add everything up on my calculator a few times just to make sure I haven't missed anything.

2007-03-08 23:03:25 · answer #1 · answered by ? 5 · 0 0

You have to get the registration page to insert into mysql using the correct commands.
See the following for a quick lesson.
http://www.webmonkey.com/99/21/index2a.html
the basic code for inserting form data looks something like
if ($submit) {

// process form

$db = mysql_connect("localhost", "root");

mysql_select_db("mydb",$db);

$sql = "INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position')";

$result = mysql_query($sql);

echo "Thank you! Information entered.\n";

} else{

// display form

?>


or get a really great book on phpmysql
its from Sams called PhP/Mysql by Meloni

2007-03-09 00:34:05 · answer #2 · answered by Tracy L 7 · 1 0

$query_string = "decide on username, e mail FROM database the place username='$username' && e mail='$e mail'"; $question = mysql_query($query_string); $num_rows = mysql_num_rows($question); if($num_rows == "0"){ $query_string = "INSERT INTO consumer (username, password, e mail, ip) VALUES('$username','$password','$e mail',... $question = mysql_query($query_string); } else{ echo "we are sorry yet that username and e mail handle is take already"; } i spotted you at the instant are not validating any suggestions in any respect and why might you enable some one with an identical consumer call or comparable e mail to sign up? i might make it to the place basically a million username can exists and an identical with the e mail. not the mixture.

2016-10-17 22:44:26 · answer #3 · answered by Anonymous · 0 0

Tracy's answer is good, but it requires register globals to be on.

I would add a hidden field to your table, name is something like "process", and give it a value of yes.

Then you would replace if($submit){ with if($_POST['process'] == 'yes'){

2007-03-09 01:57:54 · answer #4 · answered by Clinton G 2 · 0 0

fedest.com, questions and answers