Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
PHP程式裡的ID和其他問題
1.PHP裡的ID到底是甚麼意思?
我讀到一個說明看不懂ID是甚麼意思:
mysql_pconnect
"本函數和 mysql_connect() 雷同。不同的地方在於使用本函數打開數據庫時,程序會先尋找是否曾經執行過本函數,若執行過則返回先前執行的 ID。另一個不同的地方是本函數無法使用 mysql_close() 關閉數據庫。"
2."SELECT * FROM `user`"
裡面的SELECT,FROM,WHERE......之類的是甚麼意思?還有他的用法,請大概介紹一下這類的語法
3.mysql_fetch_assoc的意義和用法
4.$_SESSION[],$_SERVER[]的意義和用法,還有[]裡面的東西是甚麼,其他類似的也大概介紹一下吧
2 Answers
- EvLv 41 decade agoFavorite Answer
首先
mysql_pconnect 是與資料庫"持續"連線
mysql_connect() 是與資料庫連接一次
2.
那個是與MYSQL的SQL查詢指令
簡單介紹
新增
inser into 資料表 value(欄位的值,可以很多)
例如
insert into aaa value('1','222') 兩個欄位 資料表名稱AAA
查詢
select * from aaa 這要跟迴圈配合
$SQL=mysql_query("select * from aaa ");
while ($rrr=mysql_fetch_assoc($SQL)){
echo $rrr[欄位名稱] ;
}
有用到mysql_fetch_assoc 這樣你懂了吧
跟 mysql_fetch_array用法一樣
至於4 = =
你如果自己家裡安裝appserv
你就打 127.0.0.1/phpinfo.php
或是 IP / phpinfo.php
裡面有相關函數跟資料
例如
echo $_SERVER[REMOTE_ADDR] 就是查到使用者進來的ip
還有
$_SESSION[]
你要先建立session會期
以下是範例程式
// 1. 啟動 Session
session_start();
// 2. 登記 Session 變數名稱
session_register('foo');
// 3. 寫入 Session 變數
$_SESSION[foo] = 66;
2008-04-01 11:53:52 補充:
當然 sql 也有更難的
ORDER BY 跟 LIMIT 相關用法
可以查書
Source(s): 本身學php