Jump to content

Need help with form php/mysql


Recommended Posts

Hello

I need help with a form I created, I'm having trouble storing information from the form in a mysql database, the field that seems to be updating is the auto_increment the rest of the fields you just gives me blank, I just started using php/mysql 5 days ago, I have tried several options none seem to work

 

I'll apreciate all the help I can get, here is the form and script

 

<html>

<body>

<form action="page2.php" name="forward" method="post">

Name:<input type="text" name="name" value=<? echo $name; ?>">

Address:<input type="text" name="address" value=<? echo $name; ?>">

Career:<input type="text" name="career" value <? echo $career; ?>">

<input type="submit" name="submit" value="submit">

</form>

</body>

</html>

 

 

<html>

<body>

<?php

 

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

mysql_select_db("text");

 

$sql="insert into table1";

$sql .="(num,name,address,career)";

$sql .="values('','$name', '$address', '$career')";

 

mysql_query($sql);

?>

</body>

</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.