Jennifer
08-18-2002, 08:44 PM
I have a form which has the following action code:
<form action="insert.php" method="post">
wherein "insert.php" states:
<?php
@mysql_connect("localhost","boundby_jennifer","********");
@mysql_select_db("boundby_memrevs") or die( "Unable to select database");
$query INSERT INTO MemberReviews VALUES (",'$Memb_name','$BookName' , '$Author','$Grade','$Review')";
mysql_query($query);
mysql_close();
?>
The purpose of the form is to allow members to input their own book reviews. Have the date inputted into the Mysql database that i have created and then output the information onto a sortable database.
So far, the form looks good, but when the 'submit' button is pushed, it goes to the input.php page. I get a "page cannot be found" error.
When I go to look at the database there is no data.
The second problem that i have is creating the code to publish the 5 field data. So far, I have:
<?
$username="*******";
$password="*********";
$database="boundby_memrevs";
@mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM MemberReviews";
SELECT * FROM MemberReviews ORDER BY Author ASC
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Member Reviews</center></b><br><br>";
$i=0;
while ($i < $num) {
$Memb_Name=mysql_result($result,$i,"memb_name");
$Book=mysql_result($result,$i,"book");
I am probably totally screwed up and would appreciate all the advice given or a place where someone who is not very php literate could go and read up. Thanks in advance
Jennifer
<form action="insert.php" method="post">
wherein "insert.php" states:
<?php
@mysql_connect("localhost","boundby_jennifer","********");
@mysql_select_db("boundby_memrevs") or die( "Unable to select database");
$query INSERT INTO MemberReviews VALUES (",'$Memb_name','$BookName' , '$Author','$Grade','$Review')";
mysql_query($query);
mysql_close();
?>
The purpose of the form is to allow members to input their own book reviews. Have the date inputted into the Mysql database that i have created and then output the information onto a sortable database.
So far, the form looks good, but when the 'submit' button is pushed, it goes to the input.php page. I get a "page cannot be found" error.
When I go to look at the database there is no data.
The second problem that i have is creating the code to publish the 5 field data. So far, I have:
<?
$username="*******";
$password="*********";
$database="boundby_memrevs";
@mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM MemberReviews";
SELECT * FROM MemberReviews ORDER BY Author ASC
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Member Reviews</center></b><br><br>";
$i=0;
while ($i < $num) {
$Memb_Name=mysql_result($result,$i,"memb_name");
$Book=mysql_result($result,$i,"book");
I am probably totally screwed up and would appreciate all the advice given or a place where someone who is not very php literate could go and read up. Thanks in advance
Jennifer