µù¥U
µn¿ý
º¶
½×¾Âª©³W
¸T¤î¦Cªí
»¡©ú
¦a¹Ï
¼Æ¦ì®Ñ»
¨p¤H®ø®§ (0)
¤½¦@®ø®§ (0)
½×¾Â¥ô°È (0)
¨t²Î®ø®§ (0)
¦n¤Í®ø®§ (0)
©«¤l®ø®§ (0)
³Â»¶®a±Ú°Q½×ª©ª©
»
PHP
»
PHP+MySQL ¤Jªù¹ê§@
» ²Ä8³¹ PHP»P¸ê®Æ®w¦s¨ú(8-1 ¬d¸ß»P¨ú±o¸ê®Æ)
ªð¦^¦Cªí
¤U¤@¥DÃD
¤W¤@¥DÃD
µo©«
[±Ð¾Ç]
²Ä8³¹ PHP»P¸ê®Æ®w¦s¨ú(8-1 ¬d¸ß»P¨ú±o¸ê®Æ)
¤p»x
µoµu®ø®§
¥[¬°¦n¤Í
¤p»x
(¤p»x)
·í«eÂ÷½u
´¿¸g¤]¬O¤ô¹q¤u
UID
9
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ª÷¿ú
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
¦b½u®É¶¡
490 ¤p®É
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
¡@¼ÊºÙ:
¤p»x
¡@ÀY»Î:
´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
1
#
¸õÂà¨ì
»
¥¿§Ç¬Ý©«
¥´¦L
¦rÅé¤j¤p:
t
T
µoªí©ó 2011-4-20 09:44
|
¥u¬Ý¸Ó§@ªÌ
[±Ð¾Ç]
²Ä8³¹ PHP»P¸ê®Æ®w¦s¨ú(8-1 ¬d¸ß»P¨ú±o¸ê®Æ)
¸g¹L¤W¤@³¹ªº¬~§¡A¬Û«H±z¹ï©ó¸ê®Æ®w»P¸ê®Æªí¤w¦³°ò¦ªº»{ÃÑ¡A¦P®É¡A±zÀ³¸Ó¤]¤w²M·¡ªºª¾¹D¡Gn¦bPHP¤¤³sµ²Access¸ê®Æ®w©ÎSQL Server¥i¥H³z¹Lodbc_connect()¨ç¼Æ¡A¦Ó³sµ²MySQL Server«h¥i¥H¨Ï¥Î±MÄݪºmysql_connection()¨ç¼Æ¡C
¦]¬°¥»®Ñªº¥D¨¤¤§¤@¬°MySQL Server¡A©Ò¥H«áÄò³¹¸`±N¥H¨Ï¥ÎMySQL Server±MÄݪºmysql¨ç¼Æ¬°¾Ç²ß«ÂI¡C
mysql_connection()¨ç¼Æ¥ut³d³sµ²¸ê®Æ®w¡A¦Ü©ó¦p¦ó¦s¨ú¸ê®Æªí¤ºªº¸ê®Æ¥i´N¬£¤£¤W¥Î³õ¤F¡An¦s¨ú¸ê®Æ¥²¶·¾amysql_query()¡Bmysql_fetch_row()¡Bmysql_fetch_field()µ¥µ¥¨ç¼Æ¡C
¥»³¹¤º®e¬Ò¥HMySQL¸ê®Æ®w¬°¨Ï¥Î¹ï¶H¡A¦b½d¨Ò¥úºÐ\DataBase¥Ø¿ý¤¤¦³¤@ÓMySQL¸ê®Æ®w¡uStudent¡v¡AÀɮצWºÙ¬°Students.sql¡A½Ð±z±NÀɮ׽ƻs¨ì±zªºµwºÐ¸Ì¨Ã¨Ï¥ÎphpMyAdmin¬°¤u¨ã±N¨ä¸ü¤J¨ìMySQL Server¤¤¡A¥H¤è«K±z¾Þ§@½d¨Ò®É¨Ï¥Î¡C
students.sql
(77.25 KB)
¤U¸ü¦¸¼Æ: 6
2011-4-20 09:44
¼Ó¥D¼ö©«
½×¾Â¤£Åý¸ê¾ú¤ñ¸û²Lªº¤H¤U¸ü¬d¬Ýªþ¥óªº¥Î·N
EXCEL±MÄÝ°Q½×°Ï¦Û§Y¤é°_¤¤¾Ç¥Í¥H¤W·|û¤è
³Â»¶®a±Ú°Q½×°Ï ³q¥Îª©³W
OFFICE °ò¦±Ð¾Ç¼Æ¦ì¤Æ
ATX ¹q·½¨ÑÀ³¾¹¤â°Ê±Ò°Ê(¤£±µ¥D¾÷ªO±Ò°Ê)
¦Ò¼{Ãö³¬½×¾Âºô¯¸
³Â»¶®a±Ú°Q½×°ÏÁô¨pÅv¬Fµ¦»¡©ú
³Â»¶®a±Ú°Q½×°Ï ¸Û¼xª©¥D
¥Ñ½׾ÂÂà¶iªº¤¤¾Ç¥Íµ¥¯Å¥H¤W·|û,½ÐÃöª`!
14-2 ¸ê®Æ®w¹Ï¤ù¦s¨ú
¦¬ÂÃ
¤À¨É
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
¤p»x
µoµu®ø®§
¥[¬°¦n¤Í
¤p»x
(¤p»x)
·í«eÂ÷½u
´¿¸g¤]¬O¤ô¹q¤u
UID
9
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ª÷¿ú
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
¦b½u®É¶¡
490 ¤p®É
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
¡@¼ÊºÙ:
¤p»x
¡@ÀY»Î:
´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
3
#
µoªí©ó 2011-4-20 09:50
|
¥u¬Ý¸Ó§@ªÌ
¬d¸ß»P¨ú±o¸ê®Æªºmysql_query()¨ç¼Æ
·í¨Ï¥Îmysql_select_db()¨ç¼Æ¿ï¨ú§ÚÌn¨Ï¥Îªº¸ê®Æ®w«á¡A´N¥i¥H¶}©l§Q¥Î¡umysql_query()¡v¨ç¼Æ¨Ó¬d¸ß¨Ã¨ú±o¸ê®Æ®w¤º¬YÓ¸ê®Æªíªº¸ê®Æ°O¿ý¡G
mysql_query() ¨ç¼Æ
int mysql_query ( string query [, int link_identifier])
½Æ»s¥N½X
mysql_query()¨ç¼Æ¨Ï¥Î®É»Ýµ¹©w¨âӰѼơG
query¡G¬d¸ß¦r¦ê¡A¤]´N¬On¹ï¸ê®Æ®w¤U¹FªºSQL©R¥O¦r¦ê¡A¨Ò¦p¡uSelect¡v©R¥O¡C
link_identifier¡G³s½u¥N¸¹¡A¬YÓ¤w«Ø¥ß¨Ã§¹¦¨¸ê®Æ®w³sµ²ªº¡u³s½u¥N¸¹¡v¡A³oӰѼƥi¥H¤£«ü©w¡A¦bmysql_query()¨ç¼Æ°õ¦æ®É·|¦Û°Ê§ä´M³Ìªñ¥Ñmysql_connect()¨ç¼Æ©Ò«Ø¥ßªº³s½u¡C
¨Ò¦p¡G
Ex08_02.php
<?
$conn = mysql_connect("127.0.0.1", "root", "12345a");
if(mysql_select_db("STUDENTS", $conn))
{
//¸ê®Æ®w¦s¦b,¶i¦æ¸ê®Æ¬d¸ß
$SQL="SELECT * FROM studentlist";
mysql_query($SQL);
}
else
{
echo "¸ê®Æ®w¤£¦s¦b";
}
?>
½Æ»s¥N½X
¥Ñmysql_query()¨ç¼Æªº®æ¦¡±z¥i¥Hµo²{¨ä¦^¶ÇȬ°¤@Ó¾ã¼ÆÈ¡A¨ä¹ê¤£µM¡A¨Ò¦p§ÚÌ©Ò¤U¹FªºSQL«ü¥O¬°¡uSelect¡v¡]¨ú±o¬YÓ¸ê®Æªí¤ºªº¸ê®Æ°O¿ý¡^¡A¦pªG¶¶§Q¨ú¦^¸ê®Æ¡A«h¦^¶ÇȨä¹ê¬O¤@±iµêÀÀªº¡u¸ê®Æªí¡v¡A¤Ï¤§¡A¥¼¶¶§Q¨ú±o¸ê®Æ¦¹®É¦^¶ÇȤ~·|¬O¾ã¼Æ0¡C
·íµM¡A½d¨Òex08_02¬O¥i¥H°õ¦æªº¡A¦ý«o¥¼¹F¨ì§ÚÌ´£¨ú¸ê®Æªº¥Øªº¡A¬°¤°»ò©O¡H¦]¬°§Ų́S¦³±Nmysql_query()¨ç¼Æ°õ¦æ«áªº¦^¶Çµ²ªG«O¯d¤U¨Ó¡I©Ò¥H§ÚÌÀ³¸Ó±N½d¨Òex08_02§ó¥¿¦p¤U¡G
Ex08_03.php
¡K
if(@mysql_select_db("STUDENTS", $conn))
{
//¸ê®Æ®w¦s¦b,«Ø¥ßSQL©R¥O¦r¦ê
$SQL="SELECT * FROM studentlist";
//±N¦^¶Çµ²ªG¦s©ñ©óÅܼƤ¤
$datalist=mysql_query($SQL);
}
else
¡K
½Æ»s¥N½X
¦ó¿×SQL
SQL¬OStructure Query LanguageªºÂ²¼g¡A½Ķ¬°"µ²ºc¤Æ¬d¸ß»y¨¥"¡CSQL»y¨¥¬O¨Ï¥Î¤@¨Ç²LÅã©öÀ´ªº¤f»y¤Æ¥y¤lºc¦¨«ü¥O¡A¨Ó¦s¨ú¸ê®Æ®wªº¤º®e¡C´N¦]¬°¥¦¤f»y¤Æªº«ü¥O±Ôz¡A©Ò¥H¦U¤j¼t°Óªº¸ê®Æ®w³nÅé´N¤j¦h¨Ï¥ÎSQL»y¨¥¡A¦Ó·L³nªº¡uSQL Server¡v¥u¬O±o¨ì¤F¡u¦WºÙ¡v¤§«K½}¤F¡A¹³Orcale¡BInterbase©Î§Ú̲{¦b¨Ï¥ÎªºMySQL¸ê®Æ®wµ¥¡A³£¬O¨Ï¥ÎSQL»y¨¥ªº¸ê®Æ®w¡C
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
TOP
¤p»x
µoµu®ø®§
¥[¬°¦n¤Í
¤p»x
(¤p»x)
·í«eÂ÷½u
´¿¸g¤]¬O¤ô¹q¤u
UID
9
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ª÷¿ú
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
¦b½u®É¶¡
490 ¤p®É
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
¡@¼ÊºÙ:
¤p»x
¡@ÀY»Î:
´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
2
#
µoªí©ó 2011-4-20 09:46
|
¥u¬Ý¸Ó§@ªÌ
8-1 ¬d¸ß»P¨ú±o¸ê®Æ
·í§Ú̫إ߻PMySQL Serverªº³sµ²«á¡A²Ä¤@¥ó¨Æ±¡¤£¬O°¨¤W«æµÛ´£¨ú¸ê®Æ¡A¦Ó¬OÀ³¸Ó¿ï¨ú§ÚÌn¨Ï¥Îªº¸ê®Æ®w¡An¿ï¨ú¾Þ§@ªº¸ê®Æ®w¥i¨Ï¥Î¡umysql_select_db()¡v¨ç¼Æ¡G
mysql_select_db() ¨ç¼Æ
int mysql_select_db ( string database_name [, int link_identifier])
½Æ»s¥N½X
mysql_select_db()¨ç¼Æ¨Ï¥Î®É»Ýµ¹©w¨âӰѼơG
1¡Bdatabase_name¡G«ü©w§ÚÌn¾Þ§@ªº¸ê®Æ®w¦WºÙ¡C
2¡Blink_identifier¡G³s½u¥N¸¹¡Amysql_select_db()¨ç¼Æ¥u¯à«ü©w¾Þ§@þÓ¸ê®Æ®w¡A¨Ã¨S¦³³sµ²¸ê®Æ®wªº¯à¤O¡A¦]¦¹¡Amysql_select_db()¨ç¼Æ¥²¶·³z¹L¬YÓ¤w«Ø¥ß¨Ã§¹¦¨¸ê®Æ®w³sµ²ªº¡u³s½u¥N¸¹¡v¡A³oÓ¡u³s½u¥N¸¹¡v¬O¥Ñmysql_connect()¨ç¼Æ©Ò«Ø¥ßªº¡A³oӰѼƥi¥H¤£«ü©w¡A¦bmysql_query()¨ç¼Æ°õ¦æ®É·|¦Û°Ê§ä´M³Ìªñ¥Ñmysql_connect()¨ç¼Æ©Ò«Ø¥ßªº³s½u¡C
¨Ò¦p¡G
<?
$conn = mysql_connect("localhost", "root", "12345a");
mysql_select_db("STUDENTS", $conn);
?>
½Æ»s¥N½X
mysql_connect()¨ç¼Æ¦n¥Îªº¦a¤è¦b©ó¡G±ý³s¤Wªº¸ê®Æ®w¦øªA¾¹°Ñ¼Æ¤º®e¥i¥H¬O§Ú̳]©wªºDNS¡B¸ê®Æ®w¦øªA¾¹¦WºÙ¡A³]¸m¬O¸ê®Æ®w¦øªA¾¹ªºIP¡B¹q¸£¦WºÙ¡A¦p¤W¨Ò¤¤ªº¡ulocalhost¡v¡C¡]IP¦ì§}¡u127.0.0.1¡v»P¡ulocalhost¡v·N¸q¬Û¦P¡A¬Ò¥Nªí¥»¾÷¦øªA¾¹¡^
mysql_select_db()¨ç¼Æªº¦^¶ÇȬ°¤@¥¬ªLÈ¡AY¿ï¨ú¸ê®Æ®w¦¨¥\«h¦^¶Çtrue¡AY¥¢±Ñ«h¦^¶Çfase¡A¦]¦¹¡A§ÚÌ¥i§Q¥Îmysql_select_db()¨ç¼Æ¨Ó´úª¾¸ê®Æ®w¬O§_¦s¦b¡A¨Ò¦p¡G
Ex08_01.php
<?
$conn = mysql_connect("localhost ", "root", "12345a");
if(@mysql_select_db("STUDENTS", $conn))
{
echo "¸ê®Æ®w¦s¦b";
}
else
{
echo "¸ê®Æ®w¤£¦s¦b";
}
?>
½Æ»s¥N½X
¦b¤W¨Ò¤¤¡Gif§PÂ_¦¡¤¤«ç¦³¤@Ó¡u@¡]¤p¦Ñ¹«¡^¡v²Å¸¹¡H¦]¬°µ§ªÌ§Æ±æ¡G·ímysql_select_db()¨ç¼Æ°õ¦æ¥¢±Ñ®ÉPHP¤£n¦L¥X¦p¹Ï8-1¤¤PHP¦^À³ªº¿ù»~°T®§¡A¤]´N¬O³oÓ¡u@¡]¤p¦Ñ¹«¡^¡v²Å¸¹·|ÁôÂÃPHP¦^À³ªº¿ù»~°T®§¡I
¤U¸ü
(28.87 KB)
2011-4-20 09:48
¹Ï8-1 ¨t²Î¦^À³ªº¿ù»~°T®§¡C
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
TOP
ÀR«ä¦Û¦b :
§g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí
¤U¤@¥DÃD
¤W¤@¥DÃD
EXCEL±MÄÝ°Q½×°Ï
Excel£¸¯ë°Ï
Excelµ{¦¡°Ï
¶i¶¥À³¥Î±M°Ï
OFFICE ¨t¦C
Word
PowerPoint
Access
Office¤£¤À°Ï
µ{¦¡»y¨¥
VB »P VB.Net
C »P C#
Java »P J#
µ{¦¡³]p¤£¤À°Ï
¸ê®Æ®w
ORACLE
My SQL
MS SQL
ºô¶³]p
ASP »P ASP.NET
PHP
PHP+MySQL ¤Jªù¹ê§@
JavaScript
FLASH / ActionScript
HTM/ HTML/ CSS
ºô¶³]p¤£¤À°Ï
¹q¸£»P§@·~¨t²Î
¹q¸£¦UºØµwÅé°Q½×
¤@¯ë¹q¸£³nÅé°Q½×
½×¾Â¨Æ°È
ºÞ²z¤½§i
§ë¶D¤Ï¬M
·s¤â´ú¸Õ
·R ¡E ¥Í¬¡
¤½¯q§G§iÄæ
¥Í¬¡»P·P°Ê
[¦¬Âæ¹¥DÃD]
[Ãöª`¦¹¥DÃDªº·s¦^´_]
[³q¹L QQ¡BMSN ¤À¨Éµ¹ªB¤Í]
¥Ó½Ð¤Í±¡Ãì±µ
Facebook¯»µ·