Original Post
Alright, my problem is that I've got a script where I can add an article to the database. But...when I submit the form, I get no message saying whether the query failed or was a success. Here's my source:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<?php
require ("config.inc");
?>
<title> Add An Article </title>
</head>
<?php
// If the form was submitted, process it
if (isset($submit))
{
$query = "insert into articles values ('0', '$article_name', '$type_id', '$system_id' '$year', '$month', '$day')";
if (@mysql_query ($query))
{
echo 'The article has been added';
}
else
{
echo 'The title could not be added.' . mysql_error();
}
}
?>
<form action="<?=$PHP_SELF ?>" method="post">
Game: <input type="text" name="article_name" size="50" maxlength="100" /> <br />
Type: <select name="type_id"> <option> Select The Type Of Article </option>
<?php
// Print all the types
$query1 = "SELECT type_id, type FROM types";
$query_result1 = @mysql_query ($query1);
while ($row1 = @mysql_fetch_array ($query_result1))
{
echo "<option value=\"$row1[type_id]\"> $row1[type] </option>\n";
}
?>
</select> <br />
System: <select name="system_id"> <option> Select The System </option>
<?php
// Print all the systems
$query2 = "SELECT system_id, system FROM systems";
$query_result2 = @mysql_query ($query2);
while ($row2 = @mysql_fetch_array ($query_result2))
{
echo "<option value=\"$row2[system_id]\"> $row2[system] </option>\n";
}
?>
</select> <br />
Date Entered:
<select name="year"> <option> Year </option>
<?php
// Print the years
$year = 2003;
while ($year <= 2004)
{
print ("<option value=\"$year\"> $year </option> <br />");
$year++;
}
?>
</select>
<select name="month"> <option> Month </option>
<?php
// Print all the month nubmers
$month = 0;
while ($month <= 12)
{
print ("<option value=\"$month\"> $month </option> <br />");
$month++;
}
?>
</select>
<select name="day"> <option> Day </option>
<?php
// Print all the day number
$day = 0;
while ($day <= 31)
{
print ("<option value=\"$day\"> $day </option> <br />");
$day++;
}
?>
</select> <br />
<input type="submit" name="submit" value="Submit!" />
</form>
</body>
</html>
config.inc just has my connection to the database. I konw for a fact it's not a connection problem because the