I am trying to build a form where people can add content and store it automatically in the database.
I am recieving the following error
Here are all the articles in our database:Error performing query: Table 'article.article' doesn't exist
This is the code I am using and i don't see where the article.article is coming from.
<?php
else:
$dbcnx =@mysql_connect("localhost", "root", "password");
if (!$dbcnx)
{
echo ( "Unable to connect to the database server at this time ");
exit();
}
if(! @mysql_select_db("article"))
{
echo( "<p>Unable to locate the article database at this time.</p>");
exit ();
}
if ($submitarticle =="SUBMIT")
{
$sql ="INSERT INTO ARTICLE SET
title ='$title',
URL = '$URL',
author = '$author'
abstract = '$abstract'
article = '$article'
ad_category ='$ad_category";
if(@($sql))
{
echo ("Your article has been added");
}
else
{
echo("Error adding the last article:' mysql_error()'");
}
}
echo("Here are all the articles in our database:");
$result = @("select title from article");
if (!$result)
{
echo("Error performing query: ".
mysql_error()."</p>");
exit();
}
while ($row = mysql_fetch_array($result))
{
echo ($row["title"]);
}
echo("<a href='PHP_SELF?addarticle=1'>".
"Add an article!</a></p>");
endif;
?>