<p> <label>Введите полный текст с тэгами <textarea name="name" id="text" cols="40" rows="20"></textarea> </label> </p> </p> <tr> <td> <form method="post"> <!--<input name="search_q" type="text" size="15" maxlength="30" /> --> <input name="add" type="submit" value="Добавить" /> <input type="hidden" name="action" value="search"> <?php if($_POST['action']=="add") { $result =mysql_query ("INSERT INTO `data` (cat_id,kom_id,sd_id,city_id,name) values (`cat_id`='".(int)$_POST['cat']."', `kom_id`='".(int)$_POST['komnati']."' , `sd_id`='".(int)$_POST['sdelka']."',`city_id`='".(int)$_POST['city']."', `name`='".(int)$_POST['name']."' "); if ($result == 'true') {echo "<p> добален!</p>";} else {echo "<p> не добален!</p>";} } ?>
$sql = ("INSERT INTO `data` (cat_id,kom_id,sd_id,city_id,name) VALUES ('".intval($_POST['cat'])."', '".intval($_POST['komnati'])."', '".intval($_POST['sdelka'])."', '".intval($_POST['city'])."', '".mysql_escape_string($_POST['name'])."' "); $result = mysql_query($sql) or die (mysql_error() ."<br/>". $sql);