mysql_connect() error
| From: | sannec27 at eng dot uab dot edu | Date: | Tue, 17 Oct 2000 22:56:51 +0000 |
| Subject: | mysql_connect() error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20729@lists.php.net to get a copy of this message | ||
Hi all,
I am using Redhat 6.2, Apache 1.3.12, php 3.0.15 and MySQL 3.23.22 for a
particular project. When i am trying to connect to the MySQL database
through a PHP file i am getting the following error:
"Call to unsupported or undefined function mysql_connect() in
/home/httpd/home/submitform.php3 on line 4"
I don't understand why it is giving this error apart from realizing that
MySQL and PHP are not talking with each other. As the Redhat 6.2 comes with
PHP installed in itself i don't see any reason in recompiling or
re-installing the PHP once again! Interestingly the php3 file with the
following single line in it yielding the results what it is supposed to
give.
'<?php phpinfo(); ?>'
I don't find any fault in the httpd.conf also as it looks like this exactly:
mysql.allow_persistent=on;
mysql.max_persistent=-1;
mysql.max_links=-1;
mysql.default_port= ;
mysql.default_host= ;
mysql.default_user= ;
mysql.default_password= ;
Here is my chunk of code which is creating this error:
<html>
<body>
<?php
mysql_connect(localhost,root,mypassword);
mysql_select_db(gatherdata);
mysql_query("Insert into userinfo (first_name,last_name) values
('$first_name','$last_name')");
print ($first_name);
print ($last_name);
print ("Thanks for submitting your information");
?>
</body>
</html>
I am in great need of some help to get around this problem.
Thanks alot to whomever responds
Chakravarthy K Sannedhi