hello, im learning PHP as i go here, and have had a lot of success. However i am on now on a new project, using a new server, and cant get started!
In trying to establish a MySQL connection, i get an error 405 method not allowed.
my connection looks like this.

<?php

FileName="Connection_php_mysql.htm"

Type="MYSQL"

HTTP="true"

$hostname_test = "192.168.140.##";
$database_test = "########";
$username_test = "########";
$password_test = "######";
$test2 = mysql_pconnect($hostname_test, $username_test, $password_test) or trigger_error(mysql_error(),E_USER_ERROR);
?>

Any help here, i cant see what can be wrong. All the usernames and passwords are correct. im shhhtuck.

Any help much appreciated.

Dave

    have you tried connecting to 'localhost' instead of $hostname_test = "192.168.140.##"; ?

    worth a go.. let us know how you get on (Y)

      hmmm, i tried this but with the same result ...as in change the actual url with local host!?
      sorry im still learning!
      I see your in the grand city of Dorset! im in poole!
      Cheers
      Dave

        i work in Poole... 🙂 at work at the moment

        $ip = 'localhost';
        $user = 'root';
        $pass = 'pass';

        mysql_connect($ip,$user,$pass) or die ('mysql connect error' . mysql_error());

        hope this helps you

          im at work to...hmm not enjoying it! all that sun outside too!
          that sent the same error, i could put anything anywhere, and get the same error. im thinking the problem might not be within the PHP, as im doin exactly the same as in previous successful attempts.
          I think a connection is established...based on the quick msgs that flash up on "testing" the connection. But it then gets dropped for some reason.
          im confused!

            What OS are you running ?

            Have you created a mysql user with the correct user rights to connect via php ?

              yup, i have a MySQL account setup, and i can access the PHPmyAdmin created tables etc.
              I have tried to contact my host, however have been told although they provide database service, they do not support them, so i cant get a squeek out of them. is there anyway to interigate my user rights.
              there could be a crate of beer turning up at your place, for your help!!
              Dave

                hmm, sorry running DW OX on XP...forgot that part

                  ahhhhhhaaaaa - - - -think ive been a silly boy. PHP scripts were not enabled on my customers account. So ive just enabled that. Just got to wait till its active. then try again

                    ok have you tested mysql to make sure its actullay installad properly ?

                    you should be able to login via the start/programs/mysql menu, If you can connect using the dos like window then this rules out an error with mysql.

                    oh btw whats DW OX ?

                      Dreamweaver MX (not OX!!) crazy slang!
                      as i can connect to other database, is it safe to assu that mysql is running correctly?

                        yea, if you can connect using another account, then mysql is working correctly,#

                        good luck with your phping

                          Write a Reply...