?? createnotebook.php
字號:
<?php
echo"<META HTTP-EQUIV=\"Refresh\" Content=\" 0;URL=exa10-2.php\">";
if($date == "")
{
$date = "2002-1-1";
}
if($name != "")
{
$connect = @mysql_connect("localhost", "root", "");
mysql_select_db("NoteBook", $connect);
//判斷當(dāng)前記錄已經(jīng)使用的ID的最大值
$query = "select * from NoteBook";
$result = mysql_query($query);
$rows = @mysql_num_rows($result);
$a_row = @mysql_affected_rows($result);
$id = 0;
for($i=0; $i<$rows; $i++)
{
@mysql_data_seek($result, $i);
$data = @mysql_fetch_array($result);
if ($data[ID] > $id)
{
$id = $data[ID];
}
}
//向數(shù)據(jù)庫中添加記錄
$id++;
$query = "insert into NoteBook values('".$id."','".$name."','".$date."','".$content."')";
$result = mysql_query($query);
mysql_close($connect);
}
?>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -