Problem with connecting to MySQL from PHP script



Hi!

I have one problem and I'm hoping that someone can help me. I'm writing PHP
script and wish to connect to MySQL database from PHP script but I can't,
always get error message like this:

Fatal error: Call to undefined function mysql_connect() in C:\Program
Files\Apache Group\Apache2\htdocs\CMS3\install\connect.php on line 10

My script looks like this:

<?php
$database="cmsdbase";
$mysql_user = "root";
$mysql_password = "loz001";
$mysql_host = "localhost";
$mysql_table_prefix = "";



$success = mysql_pconnect($mysql_host, $mysql_user, $mysql_password);
if (!$success)
die ("<b>Cannot connect to database, check if username, password and host
are correct.</b>");
$success = mysql_select_db($database);
if (!$success) {
print "<b>Cannot choose database, check if database name is correct.";
die();
}
?>

I tried to use mysql_connect() but result is the same error message. Btw,
I'm using MySQL Server 4.1 and PHP 5.0.4.

Can anyone help me? Thanks!


.



Relevant Pages

  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... This is why I am thinking about rewriting my whole script in a C language. ... Perhaps there are different methods I could be using to speed up execution. ...
    (php.general)
  • Re: Unable to send mail ***caution Newbie**
    ... I get an error message "Fatal error: ... I have initializedPhpini file with Smtp address, ... Now in the below mentioned script there are fourmail.phpfiles here, ...
    (comp.lang.php)
  • Re: How to Add a Feeback Form
    ... I saw nothing in that script that indicates where the form is e-mailed to so ... Greg Maxey/Word MVP ... PHP or not. ... have the support available yet. ...
    (microsoft.public.frontpage.programming)
  • How best to show PHP source? (was: One page, multiple submit buttons)
    ... script to add to the top of a PHP script to enable showing its ... Maybe anybody submitting their own PHP code for critique here ... Anything posted to a newsgroup is a "snapshot" of what the ... there ought to be a FAQ for this ...
    (comp.lang.php)
  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... thinking about rewriting my whole script in a C language. ... execution of the code. ...
    (php.general)