1 頁 (共 1 頁)

[問題]透過browser連結mysql

發表於 : 2002-05-10 14:03
tacojohn
請問一下,我灌redhat7.2,apache、php、mysql都是安裝系統時便安裝

其中apache及php均正常,但是mysql在本機可以使用,但是\r
網頁連結時,會出現錯誤訊息\r
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/test.php on line 4

其中我test.php的內容是\r


$link=mysql_connect('localhost','root');
mysql_select_db('mysql');
$str="select * from user;";
$result=mysql_query($str,$link);
$show=mysql_num_rows($result);



請問這是什麼問題??有解決的方法嗎??

發表於 : 2002-05-10 15:47
oO]-[Oo
這段我可以跑.. 你會出現 Call to undefined function 就蠻奇怪的

[分享]你 大概沒有裝

發表於 : 2002-05-10 16:15
Jacch
你 大概沒有裝php-mysql
這一個rpm吧 ...
快去找找光碟片吧.

Re: [分享]你 大概沒有裝

發表於 : 2002-05-12 00:28
tacojohn
Jacch 寫:你 大概沒有裝php-mysql
這一個rpm吧 ...
快去找找光碟片吧.

我安裝時:
rpm -ivh php-mysql-4.0.1p12-9.i386.rpm

卻出現錯誤訊息:
error: failed dependencies:
php = 4.0.1pl2 is needed by php-mysql-4.0.1pl2-9

請問一下這是什麼問題??
php.ini也有開啟mysql的模組呀…為什麼會有錯誤呢…\r
麻煩各位幫小弟囉

發表於 : 2002-05-16 11:43
takio
這錯誤訊息看起來像是少了4.0.1pl2的package

[分享]我猜

發表於 : 2002-05-16 17:21
Jacch
版本問題 ....

你用phpinfo看看你的版本!
<?php
phpinfo();
?>


我猜大概不是4.01pl2
所以您可能要找相對應的版本.

Re: [分享]我猜

發表於 : 2002-05-17 12:39
tacojohn
Jacch 寫:版本問題 ....

你用phpinfo看看你的版本!
<?php
phpinfo();
?>


我猜大概不是4.01pl2
所以您可能要找相對應的版本.
的確是版本的問題,己經解決了,感謝各位的指導,謝謝

發表於 : 2002-05-18 11:55
Joytopi
error: failed dependencies:
php = 4.0.1pl2 is needed by php-mysql-4.0.1pl2-9

不是套件的相依性錯物嘛??