PHP增刪改查項(xiàng)目的實(shí)戰(zhàn)詳解_第1頁(yè)
PHP增刪改查項(xiàng)目的實(shí)戰(zhàn)詳解_第2頁(yè)
PHP增刪改查項(xiàng)目的實(shí)戰(zhàn)詳解_第3頁(yè)
PHP增刪改查項(xiàng)目的實(shí)戰(zhàn)詳解_第4頁(yè)
PHP增刪改查項(xiàng)目的實(shí)戰(zhàn)詳解_第5頁(yè)
已閱讀5頁(yè),還剩3頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

第PHP增刪改查項(xiàng)目的實(shí)戰(zhàn)詳解sql:

--phpMyAdminSQLDump

--version4.5.1

--

--Host:

--GenerationTime:2025-03-1517:51:32

--服務(wù)器版本:10.1.13-MariaDB

--PHPVersion:5.6.21

SETSQL_MODE="NO_AUTO_VALUE_ON_ZERO";

SETtime_zone="+00:00";

/*!40101SET@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT*/;

/*!40101SET@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS*/;

/*!40101SET@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION*/;

/*!40101SETNAMESutf8mb4*/;

--Database:`a`

----------------------------------------------------------

--表的結(jié)構(gòu)`search`

CREATETABLE`search`(

`id`int(11)NOTNULL,

`content`textCOLLATEutf8_vietnamese_ciNOTNULLCOMMENT'內(nèi)容'

)ENGINE=InnoDBDEFAULTCHARSET=utf8COLLATE=utf8_vietnamese_ci;

--轉(zhuǎn)存表中的數(shù)據(jù)`search`

INSERTINTO`search`(`id`,`content`)VALUES

(21,'陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴'),

(22,'陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴'),

(23,'陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴'),

(24,'陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴陳作業(yè)貴'),

(25,'陳作業(yè)貴'),

(26,'陳作業(yè)貴'),

(27,'陳作業(yè)貴'),

(28,'陳作業(yè)貴'),

(29,'000000'),

(30,'');

--Indexesfordumpedtables

--Indexesfortable`search`

ALTERTABLE`search`

ADDPRIMARYKEY(`id`);

--在導(dǎo)出的表使用AUTO_INCREMENT

--使用表AUTO_INCREMENT`search`

ALTERTABLE`search`

MODIFY`id`int(11)NOTNULLAUTO_INCREMENT,AUTO_INCREMENT=67;

/*!40101SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT*/;

/*!40101SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS*/;

/*!40101SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION*/;

cyg.php

php

$link=mysqli_connect('localhost','root','','a');

//然后是指定php鏈接數(shù)據(jù)庫(kù)的字符集

mysqli_set_charset($link,'utf8');

$sql="select*fromsearch";

//模糊查詢(xún)出像數(shù)據(jù)庫(kù)中的title或者content里面的值或者說(shuō)像數(shù)據(jù)庫(kù)中的title或者content里面的某一段值相對(duì)應(yīng)的就行了,就可以輸出啦

$result=mysqli_query($link,$sql);//運(yùn)行sql

!--顯示的效果--

!DOCTYPEhtml

htmllang="en"

head

metacharset="UTF-8"

titleDocument/title

/head

body

tableborder="1"cellpadding="5"

tdid/td

td標(biāo)題/td

td內(nèi)容/td

php

while($row=mysqli_fetch_array($result)){//把對(duì)象編程數(shù)組輸出,不然會(huì)報(bào)錯(cuò)哦

#code...

td=$row['id'];/td

td=$row['content'];/td

tdahref="update.phpid=phpecho$row['id'];"更新/a/td

tdahref="delete.phpid=phpecho$row['id'];"刪除/a/td

tdahref="create.php"創(chuàng)建/a/td

/tr

php

/tr

/table

/body

/html

delete.php

php

$link=mysqli_connect('localhost','root','','a');

//然后是指定php鏈接數(shù)據(jù)庫(kù)的字符集

mysqli_set_charset($link,'utf8');

//$sql="DELETEFROM`search`WHERE`id`='$_POST[id]'";

//模糊查詢(xún)出像數(shù)據(jù)庫(kù)中的title或者content里面的值或者說(shuō)像數(shù)據(jù)庫(kù)中的title或者content里面的某一段值相對(duì)應(yīng)的就行了,就可以輸出啦

$result=mysqli_query($link,"DELETEFROMsearchWHEREid='$_GET[id]'");//運(yùn)行sql

$sql="select*fromsearch";

//模糊查詢(xún)出像數(shù)據(jù)庫(kù)中的title或者content里面的值或者說(shuō)像數(shù)據(jù)庫(kù)中的title或者content里面的某一段值相對(duì)應(yīng)的就行了,就可以輸出啦

$result=mysqli_query($link,$sql);//運(yùn)行sql

!--顯示的效果--

!DOCTYPEhtml

htmllang="en"

head

metacharset="UTF-8"

titleDocument/title

/head

body

tableborder="1"cellpadding="5"

tdid/td

td標(biāo)題/td

td內(nèi)容/td

php

while($row=mysqli_fetch_array($result)){//把對(duì)象編程數(shù)組輸出,不然會(huì)報(bào)錯(cuò)哦

#code...

td=$row['id'];/td

td=$row['content'];/td

tdahref="update.phpid==$row['id'];"更新/a/td

tdahref="delete.phpid==$row['id'];"刪除/a/td

tdahref="create.php"創(chuàng)建/a/td

/tr

php

/tr

/table

/body

/html

update.php

!DOCTYPEhtml

htmllang="en"

head

metacharset="UTF-8"

titleDocument/title

/head

body

formaction="update.php"method="GET"

inputtype="hidden"name="id"value="phpecho$_GET['id']"

inputtype="text"name="content"

inputtype="submit"value="搜索"

/form

/body

/html

php

$link=mysqli_connect('localhost','root','','a');

//然后是指定php鏈接數(shù)據(jù)庫(kù)的字符集

mysqli_set_charset($link,'utf8');

//$sql="DELETEFROM`search`WHERE`id`='$_POST[id]'";

//模糊查詢(xún)出像數(shù)據(jù)庫(kù)中的title或者content里面的值或者說(shuō)像數(shù)據(jù)庫(kù)中的title或者content里面的某一段值相對(duì)應(yīng)的就行了,就可以輸出啦

$result=mysqli_query($link,"UPDATEsearchsetcontent='$_GET[content]'WHEREid='$_GET[id]'");//運(yùn)行sql

$sql="select*fromsearch";

//模糊查詢(xún)出像數(shù)據(jù)庫(kù)中的title或者content里面的值或者說(shuō)像數(shù)據(jù)庫(kù)中的title或者content里面的某一段值相對(duì)應(yīng)的就行了,就可以輸出啦

$result=mysqli_query($link,$sql);//運(yùn)行sql

!--顯示的效果--

!DOCTYPEhtml

htmllang="en"

head

metacharset="UTF-8"

titleDocument/title

/head

body

tableborder="1"cellpadding="5"

tdid/td

td標(biāo)題/td

td內(nèi)容/td

php

while($row=mysqli_fetch_array($result)){//把對(duì)象編程數(shù)組輸出,不然會(huì)報(bào)錯(cuò)哦

#code...

td=$row['id'];/td

td=$row['content'];/td

tdahref="update.phpid==$row['id'];"更新/a/td

tdahref="delete.phpid==$row['id'];"刪除/a/td

tdahref="create.php"創(chuàng)建/a/td

/tr

php

/tr

/table

/body

/html

create.php

!DOCTYPEhtml

htmllang="en"

head

metacharset="UTF-8"

titleDocument/title

/head

body

formaction="create.php"method="POST"

inputtype="text"name="content"

inputtype="submit"value="提交"

/form

/body

/html

php

if(!$_POST['content'])

exit();

$content=$_POST['content'];

$l

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論