
August 18th, 2003, 11:51 PM
|
 |
Contributing User
|
|
Join Date: Nov 2002
Location: New York City
Posts: 236
Time spent in forums: 1 Day 1 h 50 m 19 sec
Reputation Power: 6
|
|
|
Problem getting function to update DB From Form
I have a function which is suppose to take data from a form and place it into a MySQL table. For the most part it is working except for the text area portion. It changes whatever I type to the word "array".
Attached is the file with the form and below is the function
PHP Code:
function editnews($type, $title, $article, $articleid)
{
mysql_query("UPDATE news SET type='$type',title='$title',news='$article' WHERE id='$articleid'")or die('Could not enter the news article in the database. Please inform the webmaster immediately '.mysql_error());
mysql_query("OPTIMIZE TABLE news")or die("Unable to optimize table news. Please inform the <a href=mailto:webmaster@suanhacky.org>webmaster</a> all information pertaining to this error. ".mysql_error());
$newsquery=mysql_query("SELECT * FROM news WHERE id='$articleid'")or die('could not preview the Article. Please inform the webmaster immediately '.mysql_error());
$news=mysql_fetch_array($newsquery);
$posted=date("m/d/Y", strtotime($news['date']));
require_once("class.newstype.php");
echo "<table width=100% cellspacing=2 cellpadding=2 border=1><th bgcolor=#400000><center>".$news['title']." - ".$newstype." - ".posted." Posted by: ".$news['added_by']."</center></th><tr><td>".$news['news']."</td></tr></table>";
setcookie ('suanhackyeditnews',$articleid,time()-1800);
}
|