十年網(wǎng)站開(kāi)發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專業(yè)推廣+無(wú)憂售后,網(wǎng)站問(wèn)題一站解決
進(jìn)入php源程序目錄中的ext目錄中,這里存放著各個(gè)擴(kuò)展模塊的源代碼,選擇你需要的模塊,比如curl模塊:cd curl
饒河網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),饒河網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為饒河上千提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)公司要多少錢(qián),請(qǐng)找那個(gè)售后服務(wù)好的饒河做網(wǎng)站的公司定做!
執(zhí)行phpize生成編譯文件,phpize在PHP安裝目錄的bin目錄下
/usr/local/php5/bin/phpize
運(yùn)行時(shí),可能會(huì)報(bào)錯(cuò):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í)行這個(gè)命令時(shí),php會(huì)去檢查配置文件是否正確,如果有配置錯(cuò)誤,
這里會(huì)報(bào)錯(cuò),可以根據(jù)錯(cuò)誤信息去排查!
獲取ppq數(shù)據(jù)庫(kù)的所有表名的代碼:
?php
$server='localhost';
$user='root';
$pass='12345';
$dbname='ppq';
$conn=mysql_connect($server,$user,$pass);
if(!$conn)
die("數(shù)據(jù)庫(kù)系統(tǒng)連接失??!");
$result=mysql_list_tables($dbname);
if(!$result)
die("數(shù)據(jù)庫(kù)連接失?。?);
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ù)庫(kù)中的表
說(shuō)明
resource
mysql_list_tables
(
string
database
[,
resource
link_identifier])
mysql_list_tables()
接受一個(gè)數(shù)據(jù)庫(kù)名并返回和
mysql_query()
函數(shù)很相似的一個(gè)結(jié)果指針。用
mysql_fetch_array()或者用mysql_fetch_row()來(lái)獲得一個(gè)數(shù)組,數(shù)組的第0列就是數(shù)組名,當(dāng)獲取不到時(shí)
mysql_fetch_array()或者用mysql_fetch_row()返回
FALSE。
?php
//連接數(shù)據(jù)庫(kù)
$sql?=?mysql_connect('主機(jī)名','用戶名','密碼');
mysql_select_db('數(shù)據(jù)庫(kù)名');
mysql_query('utf8');
//獲取數(shù)據(jù)庫(kù)數(shù)據(jù)
$sql?=?"select?*?form?表名";
$res?=?mysql_query($sql);
$row?=?mysql_fetch_assoc($res);
?
首先你要看php.ini有沒(méi)有開(kāi)啟mysql的拓展函數(shù)庫(kù),然后mysql_connect()連接數(shù)據(jù)庫(kù),mysql_query("set names utf8");設(shè)置編碼格式,然后mysql_select_db()設(shè)置查詢的數(shù)據(jù)庫(kù)
mysql_query()執(zhí)行sql語(yǔ)句,mysql_fetch_array()或者mysql_fetch_assoc()或者mysql_fetch_num()獲取結(jié)果集,mysql_close()最后關(guān)閉數(shù)據(jù)庫(kù)連接,明白了么