- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
<?php
$ident = mysql_connect("localhost", "root", "");
mysql_select_db("database");
$month_cols = array("january" => 31,
"february" => 28,
"march" => 31,
"april" => 30,
"may" => 31,
"june" => 30,
"july" => 31,
"august" => 31,
"september" => 30,
"october" => 31,
"november" => 30,
"december" => 31);
foreach($month_cols as $key => $value)
{
for($i = 1; $i <= $value; $i++)
{
mysql_query("INSERT INTO `calender` SET `day` = '$i', `month` = '$key'");
}
}
mysql_close($ident);
?>
Недавнее творение.
Нужно было создать базу данных, которая потом будет апдейтиться.