!
. :
string(41) "Unknown column 'Тест' in 'field list'" !
:
[PHP]<?php
session_start();
include "./functions.php";
if(isset($_SESSION['adminu'])) {
?>
<html>
<head>
<title></title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="./style.css" />
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="200" style="background:url("./bg.png");" border="2" height="200"><div align="center"><img src="./images/logo.gif" style="vertical-align:middle;" /></div> <h1 align="center"></h1></td>
<td></td>
</tr>
<tr>
<td width="218" bgcolor="#FFFFFF" valign="top">
<p align="center" class="title"></p>
<div id="coolmenu">
<a href="add_cat.php"></a>
<a href="edit_cat.php"></a>
<a href="del_cat.php"></a>
</div>
<p align="center" class="title"></p>
<div id="coolmenu">
<a href="add_news.php"></a>
<a href="edit_news.php"></a>
<a href="del_news.php"></a>
</div>
<p align="center" class="title"></p>
<div id="coolmenu">
<a href="nblock.php"> </a>
<a href="users.php"></a>
<a href="/forum/admin.php"></a>
<a href="grabber.php"> </a>
</div>
</td>
<td width="476" valign="top" bordercolor="#000000" bgcolor="#FFFFFF">
<?php
if(isset($_POST['title'])) {
$title = $_POST['title'];
$lang = $_POST['lang'];
$id = $_POST['id'];
$desc = $_POST['desc'];
$text = $_POST['text'];
$date = $_POST['date'];
$cat = $_POST['cat'];
if($title != '' and $lang != '' and $text != '' and $desc != '' and $cat != '' and $id != ''and $date != '') {
$result = mysql_query("UPDATE news SET `title`=".$title.", `lang`=".$lang.", `text`=".$text.", `desc`=".$desc.", `cat`=".$cat.", `date`=".$date." WHERE id=".$id);
var_dump(mysql_error());
if($result == true) {
echo " ";
} else {
echo " !";
}
} else {
echo " , !";
}
} else {
if(isset($_GET['id'])) {
$id = $_GET['id'];
$result = mysql_query("SELECT * FROM news WHERE id=".$id);
$row = mysql_fetch_array($result);
$a = $row['cat'];
?>
<h1> </h1>
<form method="POST" action="">
<input type="hidden" value="<?php echo $row['id'] ?>" name="id" />
:
</br><input type="text" name="title" value="<?php echo $row['title'] ?>" /></br>
:</br>
<textarea name="desc" id="desc" cols="40" rows="20"><?php echo $row['desc'] ?></textarea></br>
:</br>
<textarea name="text" id="text" cols="40" rows="20"><?php echo $row['text'] ?></textarea></br>
( "2010-02-19"):
</br><input type="text" name="date" value="<?php echo $row['date']; ?>" /></br>
:
</br><select name="cat">
<?php
$result1 = mysql_query("SELECT * FROM categories");
while($row2 = mysql_fetch_array($result1)) {
if($a == $row2['cat']) {
echo "<option value='".$row2['id']."' selected>".$row2['title']."</option>";
} else {
echo "<option value='".$row2['id']."'>".$row2['title']."</option>";
}
}
?>
</select></br>
:
</br><input type="text" name="lang" value="<?php echo $row['lang']; ?>" /></br>
<input type="submit" value="" />
</form>
<?php } else {
get_news_edit();
}} ?>
</td>
</tr>
</table>
</body>
</html>
<?php
}
?>[/PHP]