|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have just installed MySql and php3 on my RedHat6.0, and everything seems ok… But this is the error message I get.
I think it must be a configuration problem, but I fail to see where.. Fatal error: Call to unsupported or undefined function mysql_connect() in /home/httpd/html/test.php3 on line 11 Here is the script: <?php mysql_connect("localhost", "webuser", ""); $query = "SELECT name, phone FROM mytable"; $result = mysql_db_query("example", $query); if($result) { echo "Found these in the db:<ul>"; while ($r = mysql_fetch_array($result)) { $name = $r["name"]; $phone = $r["phone"]; echo "<li>$name, $phone"; } echo "</ul>"; } else { echo "No data found!"; } mysql_free_result($result); ?> ------------------ -ulrik- |
|
#2
|
|||
|
|||
|
Ulrik,
have you compiled php with mysql support? Check it with phpinfo() and if there's nothing about mysql go for a customized php interpreter. Ulf |
|
#3
|
|||
|
|||
|
Err..
No MySql was mentioned in the phpinfo(). So I guess I don’t have any support for it. But what is it that you say that I need?(customized php interpreter)? And where do I get It? ------------------ -ulrik- |
|
#4
|
|||
|
|||
|
MySQL support is included in the PHP package, but you have to specify that it be compiled in. (during PHP 'configure' stage: ./configure --with-apache=/path/to/apache --with-mysql=/path/to/mysql).
If you're using binary RPMs, you should probably uninstall those and do a fresh install of PHP/Apache straight from the source tarballs (downloaded from respective websites). |
|
#5
|
|||
|
|||
|
hello there
I have the same proble, but I'm running php,mysql and apache on an NT machine any ideas ? |
|
#6
|
|||
|
|||
|
Ulrik,
I recognize the script you are trying to run. You probably got it at: http://www.sfu.ca/~yzhang/linux/webdb/ If you follow carefully all of Ying Zhang's instructions about compiling Apache, PHP, and MySQL, it works every time. Give it a try, but be careful not to miss a step. |
|
#7
|
|||
|
|||
|
Hi there!
Thanks for all your reply's.. I got it running now. regards ------------------ -ulrik- |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > MySql, php3 problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|