boot
Новичок
не могу в нести дату в базу
есть запросс
<?php
if(isset($_POST['reg'])) {
$short_title=$_POST['short_title'];
$title=$_POST['title'];
$short_content=$_POST['short_content'];
$content=$_POST['content'];
$year=$_POST['year'];
$month=$_POST['month'];
$day=$_POST['day'];
}
$query = "insert into news values ('', '1', '1', '$short_title', '$title', '$date', '$short_content', '$content')";
$result = mysql_query($query, $link) or die(mysql_error());
как правильно передать параметры
$year=$_POST['year'];
$month=$_POST['month'];
$day=$_POST['day'];
переменной $date
чтобы в базе в поле date было значение 2007-05-01
есть запросс
<?php
if(isset($_POST['reg'])) {
$short_title=$_POST['short_title'];
$title=$_POST['title'];
$short_content=$_POST['short_content'];
$content=$_POST['content'];
$year=$_POST['year'];
$month=$_POST['month'];
$day=$_POST['day'];
}
$query = "insert into news values ('', '1', '1', '$short_title', '$title', '$date', '$short_content', '$content')";
$result = mysql_query($query, $link) or die(mysql_error());
как правильно передать параметры
$year=$_POST['year'];
$month=$_POST['month'];
$day=$_POST['day'];
переменной $date
чтобы в базе в поле date было значение 2007-05-01