Click to See Complete Forum and Search --> : Form Input Into a MySQL DB


mikegreenia.com
07-28-2007, 01:11 PM
I'm somewhat new to php and I'm stuck trying to figure something out. I want to enter data into a form and when I press submit I want that to go into my table. Here is what I got so far. I know that you can use {ollo} for a place holder but I think that's where my code is going wrong

addmovie.php | the form


<form action="addnewmovie.php" method="post">
Movie Name:<input type="text" name="varMovie" size="30" />
Book:<input type="text" name="varBook" size="3" />
Page:<input type="text" name="varPage" size="3" />
Feature:<input type="text" name="varFeature" size="20" />

<input type = "submit" value = "Add Movie">
</form>


addnewmovie.php | the php and mysql


<?

include("connect.php");

mysql_query("INSERT INTO dvds
(movie, book, page, feature) VALUES({ollo}, {ollo}, {ollo}, {ollo} ) ")
or die(mysql_error());

?>

mikegreenia.com
07-28-2007, 01:25 PM
nevermind I figured it out:


$movie=$_POST['varMovie'];
$book=$_POST['varBook'];
$page=$_POST['varPage'];
$feature=$_POST['varFeature'];