Ok guys heres my problem. I am updating some news here. Here is where you insert the news to be updated
<?
require ("config.php");
$connection = @mysql_connect($server, $user, $password) or die("Couldn't Connect.");
$db = @mysql_select_db($dbname, $connection) or die("Couldnt select database.");
$sql = "select * FROM news WHERE archive !='yes' limit 2";
$result = @($sql,$connection) or die("Couldn't ececute query.");
while ($row = mysql_fetch_array($result)) {
echo"<form action='update_news.php?id=$row[id]' method='post'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td height='6' valign='top' width='17%' class='text'> Add News Section </td>
<td width='83%'></td>
</tr>
<tr>
<td height='6' valign='top' width='17%' class='text'>Date</td>
<td width='83%'>
<input type='text' name='date' value='$row[date]'>
</td>
</tr>
<tr>
<td valign='top' width='17%' class='text'> Title: </td>
<td width='83%'>
<input type='text' name='title' size='60' value='$row[title]'>
</td>
</tr>
<tr>
<td valign='top' width='17%' class='text'>Teaser: <br>
(This is where you add a small amount of the News) </td>
<td width='83%'>
<input type='text' name='teaser' size='60' value='$row[teaser]'>
</td>
</tr>
<tr>
<td width='17%' class='text'>News</td>
<td rowspan='2' width='83%'><font size='2' face='Verdana'>
<textarea name='text' cols='60' rows='12'>$row[text]</textarea>
</font></td>
</tr>
<tr>
<td width='17%'> </td>
</tr>
<tr>
<td width='17%' class='text'><input type='checkbox' name='archive' value='archive'> Archive Article
</td>
<td width='83%'> </td>
</tr>
</table><input type='submit' name='Submit' value='Update News'></form>";
}
?>
and here is the second page where it gets updated
<? include ("header.php");?>
<table border=3 width=750 cellpadding=7>
<tr>
<td bgcolor="#0099FF" class="boldtitleverdana">Update News</td>
</tr>
<tr>
<td> <?
require ("config.php");
$connection = @mysql_connect($server, $user, $password) or die("Couldn't Connect.".mysql_error());
$db = @mysql_select_db($dbname, $connection) or die("Couldnt select database.".mysql_error());
$sql = "UPDATE news SET date = $date, title = $title, teaser = $teaser, text = $text WHERE id ='$id'";
$result = @($sql,$connection) or die("Couldn't ececute query.".mysql_error());
while ($row = mysql_fetch_array($result)) {
echo"
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td height='6' valign='top' width='17%' class='text'> News Properly Updated<br>Updated Text below </td>
<td width='83%'></td>
</tr>
<tr>
<td height='6' valign='top' width='17%' class='text'>Date</td>
<td width='83%'>
$date
</td>
</tr>
<tr>
<td valign='top' width='17%' class='text'> Title: </td>
<td width='83%'>
$title
</td>
</tr>
<tr>
<td valign='top' width='17%' class='text'>Teaser: <br>
</td>
<td width='83%'>
$teaser
</td>
</tr>
<tr>
<td width='17%' class='text'>News</td>
<td rowspan='2' width='83%'><font size='2' face='Verdana'>
$text
</font></td>
</tr>
<tr>
<td width='17%'> </td>
</tr>
<tr>
<td width='17%'></td>
<td width='83%'> </td>
</tr>
</table>";
}
?>
</td></tr></table>
<? include ("footer.php");?>
Here is the error that i get
Couldn't ececute query.Unknown column 'hfgggdfhgestghytutyuhrthtewtywjwj' in 'field list'
Why is this