יש לי את השאילתא הבאה :
PHP קוד:
CREATE TABLE `articles` (
`id` int(11) NOT NULL auto_increment,
`ip` varchar(45) NOT NULL,
`date` varchar(100) NOT NULL,
`author` text NOT NULL,
`subject` text NOT NULL,
`category` text NOT NULL,
`description` text NOT NULL,
`content` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=hebrew AUTO_INCREMENT=3 ;
לא נראה לי שהיא טובה בכלל.. כי דרך המערכת זה לא מכניס..
וזה החלק שאחראי על ההוספה :
PHP קוד:
if(isset($_POST['sumbit'])){
$ip = $_SERVER['REMOTE_ADDR'] ;
$date = date("j/n/Y") ;
$author = $_POST['author'] ;
$subject = $_POST['subject'] ;
$category = $_POST['category'] ;
$description = $_POST['description'] ;
$content = $_POST['content'] ;
if($author != "" & $subject != "" & $category != "" & $description != "" & $content != ""){
$query = "INSERT INTO `articles` (`ip`, `date`, `author`, `subject`, `category`, `description`, `content`) VALUES('$ip', '$date', '$author', '$subject', '$category', '$description', '$content')";
$result = mysql_query($query)
or die("Query failed: " . mysql_error());
echo "הכתבה נשלחה !" ;
}else{
echo "אנא מלא את כל השדות" ;
}
}
תודה לעוזרים.