LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL commands not recognised by PHP4 (https://www.linuxquestions.org/questions/linux-software-2/mysql-commands-not-recognised-by-php4-264568/)

Christopher 12-09-2004 02:51 PM

MySQL commands not recognised by PHP4
 
Hi

I have installed Apache 1.3, and PHP4 is working fine with it. I also know that MySQL is up and running fine, and I have no problems using phpmyadmin. However, when it comes to using mysql_connect() I get the following error:

Fatal error: Call to undefined function: mysql_connect() in /home/crisp/www/myapp/dbconn.php on line 2

I have installed php4-mysql via apt-get, which is described as a package that "provides a module for MySQL database connections directly from PHP scripts", so I don't see what the problem is.

Any ideas? Thanks,

-Chris

J.W. 12-09-2004 05:16 PM

Question: are you literally invoking just "mysql_connect()" or are you passing it the required parameters, for example
Code:

mysql_connect(localhost,$username,$password);
where localhost, $username, and $password are appropriate for your server and database. It may also be helpful to post the contents of the dbconn.php file (making sure to remove/disguise any actual login ID's, passwords, etc) My guess is that this error may just be due to a syntax error, although take that with a grain of salt -- I do not claim to be an expert by any stretch of the imagination.

Lastly, you may also want to ask this question in the Programming forum rather than the generic Software forum. If so, click on the Report This Post to a Moderator, and simply request that it be moved. -- J.W.


All times are GMT -5. The time now is 08:42 PM.