資源簡介
php超簡單的源碼小程序,通過sql語句實現(xiàn)數(shù)據(jù)庫的增刪改查基本功能,適合剛?cè)腴T的新手參照,同時也是php實例入門小程序,可進(jìn)行收藏的源碼文檔。
剛?cè)腴T的新手往往不知道如何使用php操作mysql數(shù)據(jù)庫,其實無非就是利用sql語句進(jìn)行數(shù)據(jù)庫的操作,這是一款能夠?qū)崿F(xiàn)增刪改查的小系統(tǒng)。很簡單,很實用,適合初學(xué)者由簡入深的學(xué)習(xí)。
本程序的核心功能有:
1,php連接mysql數(shù)據(jù)庫。
2,通過sql語句查詢內(nèi)容。
3,分類顯示mysql數(shù)據(jù)庫中的內(nèi)容。
4,分頁顯示mysql數(shù)據(jù)庫中的內(nèi)容。
5,通過sql語句添加內(nèi)容
6,通過sql語句修改內(nèi)容
7,通過sql語句刪除內(nèi)容
代碼片段和文件信息
ob_start();
session_start();
require(“config.php“);
?>
lns=“http://www.w3.org/1999/xhtml“>
ta?http-equiv=“Content-Type“?content=“text/html;?charset=gb2312“?/>
nk?href=“/style.css“?rel=“stylesheet“?type=“text/css“?/>
tle>插入數(shù)據(jù)庫數(shù)據(jù) tle>
if($_POST[“Submit“])
{
$typ=$_POST[“typ“];
$content=$_POST[“content“];
$author=$_POST[“author“];
$sql=“insert?into?contents(titlecontentsauthor)?values?($typ‘$content‘‘$author‘)“;
mysql_query($sql);
header(“l(fā)ocation:index.php?id=$typ“);
}
$sql=“select?*?from?title“;
$rs=mysql_query($sql);
?>
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-10-30?22:17??phpjiandan\
?????文件????????2098??2013-03-10?22:28??phpjiandan\add.php
?????文件?????????182??2013-03-05?23:05??phpjiandan\config.php
?????文件?????????539??2013-03-10?21:58??phpjiandan\del.php
?????文件????????5052??2013-05-04?21:47??phpjiandan\index.php
?????文件????????3607??2013-05-04?21:44??phpjiandan\joke.sql
?????文件????????2310??2013-03-10?22:28??phpjiandan\modify.php
?????文件?????????649??2013-03-05?23:16??phpjiandan\st
?????文件?????????640??2013-05-04?21:45??phpjiandan\簡單的一款PHP+MYSQL增刪改查程序.txt
評論
共有 條評論