進(jìn)入php源程序目錄中的ext目錄中,這里存放著各個擴(kuò)展模塊的源代碼,選擇你需要的模塊,比如curl模塊:cd curl

饒河網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),饒河網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為饒河上千提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)公司要多少錢,請找那個售后服務(wù)好的饒河做網(wǎng)站的公司定做!
執(zhí)行phpize生成編譯文件,phpize在PHP安裝目錄的bin目錄下
/usr/local/php5/bin/phpize
運(yùn)行時,可能會報錯:Cannot find autoconf. Please check your autoconf installation and
the $PHP_AUTOCONF
environment variable is set correctly and then rerun this
script.,需要安裝autoconf:
yum install autoconf(RedHat或者CentOS)、apt-get install
autoconf(Ubuntu Linux)
/usr/local/php5/bin/php -v
執(zhí)行這個命令時,php會去檢查配置文件是否正確,如果有配置錯誤,
這里會報錯,可以根據(jù)錯誤信息去排查!
獲取ppq數(shù)據(jù)庫的所有表名的代碼:
?php
$server='localhost';
$user='root';
$pass='12345';
$dbname='ppq';
$conn=mysql_connect($server,$user,$pass);
if(!$conn)
die("數(shù)據(jù)庫系統(tǒng)連接失敗!");
$result=mysql_list_tables($dbname);
if(!$result)
die("數(shù)據(jù)庫連接失敗!");
while($row=mysql_fetch_row($result))
{
echo
$row[0]."
";
}
mysql_free_result($result);
?
mysql_list_tables
(PHP
3,
PHP
4
,
PHP
5)
mysql_list_tables
--
列出
MySQL
數(shù)據(jù)庫中的表
說明
resource
mysql_list_tables
(
string
database
[,
resource
link_identifier])
mysql_list_tables()
接受一個數(shù)據(jù)庫名并返回和
mysql_query()
函數(shù)很相似的一個結(jié)果指針。用
mysql_fetch_array()或者用mysql_fetch_row()來獲得一個數(shù)組,數(shù)組的第0列就是數(shù)組名,當(dāng)獲取不到時
mysql_fetch_array()或者用mysql_fetch_row()返回
FALSE。
?php
//連接數(shù)據(jù)庫
$sql?=?mysql_connect('主機(jī)名','用戶名','密碼');
mysql_select_db('數(shù)據(jù)庫名');
mysql_query('utf8');
//獲取數(shù)據(jù)庫數(shù)據(jù)
$sql?=?"select?*?form?表名";
$res?=?mysql_query($sql);
$row?=?mysql_fetch_assoc($res);
?
首先你要看php.ini有沒有開啟mysql的拓展函數(shù)庫,然后mysql_connect()連接數(shù)據(jù)庫,mysql_query("set names utf8");設(shè)置編碼格式,然后mysql_select_db()設(shè)置查詢的數(shù)據(jù)庫
mysql_query()執(zhí)行sql語句,mysql_fetch_array()或者mysql_fetch_assoc()或者mysql_fetch_num()獲取結(jié)果集,mysql_close()最后關(guān)閉數(shù)據(jù)庫連接,明白了么
網(wǎng)站題目:php數(shù)據(jù)庫怎么獲得 php從數(shù)據(jù)庫取數(shù)據(jù)輸出
文章源于:http://chinadenli.net/article36/dodpspg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、網(wǎng)站收錄、網(wǎng)站策劃、網(wǎng)站建設(shè)、動態(tài)網(wǎng)站、虛擬主機(jī)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)