I am posting reviews from a form:
<center><B>Article/Review Submission</B><BR>
<form method="post">
Name:
<input name="name" type="text" size="30"><BR>
Email:
<input name="email" type="text" size="30"><BR><BR>Article Content:<BR>
<textarea name="review" cols="70" rows="5"></textarea><BR>
<input name="SUBMIT" type="submit">
</form></center>
<?php
// Connect to the database server
$dbcnx = @mysql_connect("localhost");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
// Select the database
if (! @mysql_select_db("Articles") ) {
echo( "<P>Unable to locate the Articles " .
"database at this time.</P>" );
exit();
}
?>
<?PHP
if ("SUBMIT" == $submit) {
$query = mysql_query("INSERT INTO Articles(review, LinkDate, email, name) VALUES('$review', '$email','$name', 'CURDATE()')") or die(mysql_error());
};
?>
That seems fine, although i dont know if its writing data as i cannot tell.
I then goto the page to recall the data and nothing appears except title.
<?php
// Connect to the database server
$dbcnx = @mysql_connect("localhost");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
// Select the database
if (! @mysql_select_db("Articles") ) {
echo( "<P>Unable to locate the News " .
"database at this time.</P>" );
exit();
}
?>
<center><B>User Submitted Articles</B><BR><BR>
<?php
// Request the text of the latest News
$result = mysql_query(
"select * from articles order by id desc limit 100");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
// Display the articles
while ( $row = mysql_fetch_array($result) ) {
echo "<BR>" . $row["name"] . "<BR>";
echo("<BR>" . $row["email"] . "<BR>");
echo("<BR>" . $row["review"] . "<BR>");
echo("<BR>" . $row["linkdate"] . "<BR>");
}
?>
</center>
any ideas? please tell me where i have gone wrong