MySQL connect failure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce A. Julseth

    MySQL connect failure

    I have the following code

    $Host = "localhost" ;
    $User = "Fred";
    $Database = "house";
    $Password = "mypw"

    echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
    $Database;

    @ $db = new mysqli($Host, $User, $Password);

    echo "Connection is " . mysqli_connect_ errno();

    The first echo is executed but the second is not. I have ran the very same
    parameters from the command line using:

    mysql -h localhost -u Fred -p

    Then

    use house

    and I connect to the house database.

    I tried this in both IE 7 and Firefox with the same results.

    I'm new to this stuff so all help will be appreciated.

    Thanks..




  • Jeff

    #2
    Re: MySQL connect failure

    Get rid of the @ in front of the $db = new mysqli( ...

    That is suppressing any errors on that line of code. Then it should
    show you in your browser what the error is and then we can help you
    further.

    Also, you can include $Database as the 4th parameter in your mysqli
    constructor to connect to that specific database.

    Comment

    • Bruce A. Julseth

      #3
      Re: MySQL connect failure


      "Jeff" <jeff@quixion.n etwrote in message
      news:1174344779 .712020.258000@ p15g2000hsd.goo glegroups.com.. .
      Get rid of the @ in front of the $db = new mysqli( ...
      >
      That is suppressing any errors on that line of code. Then it should
      show you in your browser what the error is and then we can help you
      further.
      >
      Also, you can include $Database as the 4th parameter in your mysqli
      constructor to connect to that specific database.
      >
      Okay, I now have

      $Host = "localhost" ;
      $User = "Fred";
      $Database = "house";
      $Password = "mypw"

      echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
      $Database;

      $db = new mysqli($Host, $User, $Password);

      echo "Connection is " . mysqli_connect_ errno();

      I didn't add the database to the mysqli parameter list.

      I still never got to the 2nd echo statement. Firefox gives me a "done" in
      the lower left corner. The "mysqli" is the very first MySQL command I
      execute in my program. Do I need "Create" or "instantiat e" something first?
      I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm not sure
      what version. How can I find out?]



      Comment

      • Jerry Stuckle

        #4
        Re: MySQL connect failure

        Bruce A. Julseth wrote:
        "Jeff" <jeff@quixion.n etwrote in message
        news:1174344779 .712020.258000@ p15g2000hsd.goo glegroups.com.. .
        >Get rid of the @ in front of the $db = new mysqli( ...
        >>
        >That is suppressing any errors on that line of code. Then it should
        >show you in your browser what the error is and then we can help you
        >further.
        >>
        >Also, you can include $Database as the 4th parameter in your mysqli
        >constructor to connect to that specific database.
        >>
        >
        Okay, I now have
        >
        $Host = "localhost" ;
        $User = "Fred";
        $Database = "house";
        $Password = "mypw"
        >
        echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
        $Database;
        >
        $db = new mysqli($Host, $User, $Password);
        >
        echo "Connection is " . mysqli_connect_ errno();
        >
        I didn't add the database to the mysqli parameter list.
        >
        I still never got to the 2nd echo statement. Firefox gives me a "done" in
        the lower left corner. The "mysqli" is the very first MySQL command I
        execute in my program. Do I need "Create" or "instantiat e" something first?
        I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm not sure
        what version. How can I find out?]
        >
        >
        >
        Add this to the beginning of your script:

        error_reporting (E_ALL);
        ini_set("displa y_errors", "1");

        And see what error messages you get. Or check your PHP error log (which
        may be in the Apache log).

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • Bruce A. Julseth

          #5
          Re: MySQL connect failure


          "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
          news:IamdnTLNMr gA02LYnZ2dnUVZ_ oLinZ2d@comcast .com...
          Bruce A. Julseth wrote:
          >"Jeff" <jeff@quixion.n etwrote in message
          >news:117434477 9.712020.258000 @p15g2000hsd.go oglegroups.com. ..
          >>Get rid of the @ in front of the $db = new mysqli( ...
          >>>
          >>That is suppressing any errors on that line of code. Then it should
          >>show you in your browser what the error is and then we can help you
          >>further.
          >>>
          >>Also, you can include $Database as the 4th parameter in your mysqli
          >>constructor to connect to that specific database.
          >>>
          >>
          >Okay, I now have
          >>
          > $Host = "localhost" ;
          > $User = "Fred";
          > $Database = "house";
          > $Password = "mypw"
          >>
          > echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
          >$Database;
          >>
          > $db = new mysqli($Host, $User, $Password);
          >>
          > echo "Connection is " . mysqli_connect_ errno();
          >>
          >I didn't add the database to the mysqli parameter list.
          >>
          >I still never got to the 2nd echo statement. Firefox gives me a "done" in
          >the lower left corner. The "mysqli" is the very first MySQL command I
          >execute in my program. Do I need "Create" or "instantiat e" something
          >first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
          >not sure what version. How can I find out?]
          >>
          >>
          >>
          >
          Add this to the beginning of your script:
          >
          error_reporting (E_ALL);
          ini_set("displa y_errors", "1");
          >
          And see what error messages you get. Or check your PHP error log (which
          may be in the Apache log).
          >
          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===
          Adding the above code gave the error message:

          Fatal error: Class 'mysqli' not found in
          C:\Inetpub\wwwr oot\SerenadeHOA \php\functions. php on line 47

          This implies to me that I have a configuration problem. What should I look
          for.

          My php.ini is in my C:\windows directory.:
          I have extension_dir = "c:/php5/ext"

          What else should I check?

          Thanks..


          Comment

          • Erwin Moller

            #6
            Re: MySQL connect failure

            Bruce A. Julseth wrote:
            >
            "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            news:IamdnTLNMr gA02LYnZ2dnUVZ_ oLinZ2d@comcast .com...
            >Bruce A. Julseth wrote:
            >>"Jeff" <jeff@quixion.n etwrote in message
            >>news:11743447 79.712020.25800 0@p15g2000hsd.g ooglegroups.com ...
            >>>Get rid of the @ in front of the $db = new mysqli( ...
            >>>>
            >>>That is suppressing any errors on that line of code. Then it should
            >>>show you in your browser what the error is and then we can help you
            >>>further.
            >>>>
            >>>Also, you can include $Database as the 4th parameter in your mysqli
            >>>constructo r to connect to that specific database.
            >>>>
            >>>
            >>Okay, I now have
            >>>
            >> $Host = "localhost" ;
            >> $User = "Fred";
            >> $Database = "house";
            >> $Password = "mypw"
            >>>
            >> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
            >> .
            >>$Database;
            >>>
            >> $db = new mysqli($Host, $User, $Password);
            >>>
            >> echo "Connection is " . mysqli_connect_ errno();
            >>>
            >>I didn't add the database to the mysqli parameter list.
            >>>
            >>I still never got to the 2nd echo statement. Firefox gives me a "done"
            >>in the lower left corner. The "mysqli" is the very first MySQL command I
            >>execute in my program. Do I need "Create" or "instantiat e" something
            >>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
            >>not sure what version. How can I find out?]
            >>>
            >>>
            >>>
            >>
            >Add this to the beginning of your script:
            >>
            >error_reportin g(E_ALL);
            >ini_set("displ ay_errors", "1");
            >>
            >And see what error messages you get. Or check your PHP error log (which
            >may be in the Apache log).
            >>
            >--
            >============== ====
            >Remove the "x" from my email address
            >Jerry Stuckle
            >JDS Computer Training Corp.
            >jstucklex@attgl obal.net
            >============== ====
            >
            Adding the above code gave the error message:
            >
            Fatal error: Class 'mysqli' not found in
            C:\Inetpub\wwwr oot\SerenadeHOA \php\functions. php on line 47
            >
            This implies to me that I have a configuration problem. What should I look
            for.
            >
            My php.ini is in my C:\windows directory.:
            I have extension_dir = "c:/php5/ext"
            >
            What else should I check?
            search for mysqli in your php.ini and comment it in.
            Make sure you have the file in a place where PHP looks.

            Next thing to do is running phpinfo() and see if it finds and loads mysqli.

            Good luck.

            Regards,
            Erwin Moller
            >
            Thanks..

            Comment

            • Bruce A. Julseth

              #7
              Re: MySQL connect failure


              "Erwin Moller"
              <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote in
              message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
              Bruce A. Julseth wrote:
              >
              >>
              >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              >news:IamdnTLNM rgA02LYnZ2dnUVZ _oLinZ2d@comcas t.com...
              >>Bruce A. Julseth wrote:
              >>>"Jeff" <jeff@quixion.n etwrote in message
              >>>news:1174344 779.712020.2580 00@p15g2000hsd. googlegroups.co m...
              >>>>Get rid of the @ in front of the $db = new mysqli( ...
              >>>>>
              >>>>That is suppressing any errors on that line of code. Then it should
              >>>>show you in your browser what the error is and then we can help you
              >>>>further.
              >>>>>
              >>>>Also, you can include $Database as the 4th parameter in your mysqli
              >>>>construct or to connect to that specific database.
              >>>>>
              >>>>
              >>>Okay, I now have
              >>>>
              >>> $Host = "localhost" ;
              >>> $User = "Fred";
              >>> $Database = "house";
              >>> $Password = "mypw"
              >>>>
              >>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
              >>> .
              >>>$Database;
              >>>>
              >>> $db = new mysqli($Host, $User, $Password);
              >>>>
              >>> echo "Connection is " . mysqli_connect_ errno();
              >>>>
              >>>I didn't add the database to the mysqli parameter list.
              >>>>
              >>>I still never got to the 2nd echo statement. Firefox gives me a "done"
              >>>in the lower left corner. The "mysqli" is the very first MySQL command
              >>>I
              >>>execute in my program. Do I need "Create" or "instantiat e" something
              >>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
              >>>not sure what version. How can I find out?]
              >>>>
              >>>>
              >>>>
              >>>
              >>Add this to the beginning of your script:
              >>>
              >>error_reporti ng(E_ALL);
              >>ini_set("disp lay_errors", "1");
              >>>
              >>And see what error messages you get. Or check your PHP error log (which
              >>may be in the Apache log).
              >>>
              >>--
              >>============= =====
              >>Remove the "x" from my email address
              >>Jerry Stuckle
              >>JDS Computer Training Corp.
              >>jstucklex@attgl obal.net
              >>============= =====
              >>
              >Adding the above code gave the error message:
              >>
              >Fatal error: Class 'mysqli' not found in
              >C:\Inetpub\www root\SerenadeHO A\php\functions .php on line 47
              >>
              >This implies to me that I have a configuration problem. What should I
              >look
              >for.
              >>
              >My php.ini is in my C:\windows directory.:
              >I have extension_dir = "c:/php5/ext"
              >>
              >What else should I check?
              >
              search for mysqli in your php.ini and comment it in.
              Make sure you have the file in a place where PHP looks.
              >
              Next thing to do is running phpinfo() and see if it finds and loads
              mysqli.
              >
              Good luck.
              >
              Regards,
              Erwin Moller
              >
              >>
              >Thanks..
              >
              I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
              reference to mysqli. I am referencing C:\Windows\php. ini and that's the
              correct directory.

              Here are the mysqli settings in my php.ini.

              [MySQLi]

              ; Maximum number of links. -1 means no limit.
              mysqli.max_link s = -1

              ; Default port number for mysqli_connect( ). If unset, mysqli_connect( ) will
              use
              ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
              ; compile-time value defined MYSQL_PORT (in that order). Win32 will only
              look
              ; at MYSQL_PORT.
              mysqli.default_ port = 3306

              ; Default socket name for local MySQL connects. If empty, uses the built-in
              ; MySQL defaults.
              mysqli.default_ socket =

              ; Default host for mysql_connect() (doesn't apply in safe mode).
              mysqli.default_ host =

              ; Default user for mysql_connect() (doesn't apply in safe mode).
              mysqli.default_ user =

              ; Default password for mysqli_connect( ) (doesn't apply in safe mode).
              ; Note that this is generally a *bad* idea to store passwords in this file.
              ; *Any* user with PHP access can run 'echo get_cfg_var("my sqli.default_pw ")
              ; and reveal this password! And of course, any users with read access to
              this
              ; file will be able to reveal the password as well.
              mysqli.default_ pw =

              ; Allow or prevent reconnect
              mysqli.reconnec t = Off


              Comment

              • Jerry Stuckle

                #8
                Re: MySQL connect failure

                Bruce A. Julseth wrote:
                "Erwin Moller"
                <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote in
                message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                >Bruce A. Julseth wrote:
                >>
                >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                >>news:IamdnTLN MrgA02LYnZ2dnUV Z_oLinZ2d@comca st.com...
                >>>Bruce A. Julseth wrote:
                >>>>"Jeff" <jeff@quixion.n etwrote in message
                >>>>news:117434 4779.712020.258 000@p15g2000hsd .googlegroups.c om...
                >>>>>Get rid of the @ in front of the $db = new mysqli( ...
                >>>>>>
                >>>>>That is suppressing any errors on that line of code. Then it should
                >>>>>show you in your browser what the error is and then we can help you
                >>>>>further.
                >>>>>>
                >>>>>Also, you can include $Database as the 4th parameter in your mysqli
                >>>>>constructo r to connect to that specific database.
                >>>>>>
                >>>>Okay, I now have
                >>>>>
                >>>> $Host = "localhost" ;
                >>>> $User = "Fred";
                >>>> $Database = "house";
                >>>> $Password = "mypw"
                >>>>>
                >>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
                >>>> .
                >>>>$Database ;
                >>>>>
                >>>> $db = new mysqli($Host, $User, $Password);
                >>>>>
                >>>> echo "Connection is " . mysqli_connect_ errno();
                >>>>>
                >>>>I didn't add the database to the mysqli parameter list.
                >>>>>
                >>>>I still never got to the 2nd echo statement. Firefox gives me a "done"
                >>>>in the lower left corner. The "mysqli" is the very first MySQL command
                >>>>I
                >>>>execute in my program. Do I need "Create" or "instantiat e" something
                >>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
                >>>>not sure what version. How can I find out?]
                >>>>>
                >>>>>
                >>>>>
                >>>Add this to the beginning of your script:
                >>>>
                >>>error_report ing(E_ALL);
                >>>ini_set("dis play_errors", "1");
                >>>>
                >>>And see what error messages you get. Or check your PHP error log (which
                >>>may be in the Apache log).
                >>>>
                >>>--
                >>>============ ======
                >>>Remove the "x" from my email address
                >>>Jerry Stuckle
                >>>JDS Computer Training Corp.
                >>>jstucklex@attgl obal.net
                >>>============ ======
                >>Adding the above code gave the error message:
                >>>
                >>Fatal error: Class 'mysqli' not found in
                >>C:\Inetpub\ww wroot\SerenadeH OA\php\function s.php on line 47
                >>>
                >>This implies to me that I have a configuration problem. What should I
                >>look
                >>for.
                >>>
                >>My php.ini is in my C:\windows directory.:
                >>I have extension_dir = "c:/php5/ext"
                >>>
                >>What else should I check?
                >search for mysqli in your php.ini and comment it in.
                >Make sure you have the file in a place where PHP looks.
                >>
                >Next thing to do is running phpinfo() and see if it finds and loads
                >mysqli.
                >>
                >Good luck.
                >>
                >Regards,
                >Erwin Moller
                >>
                >>Thanks..
                >
                I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                reference to mysqli. I am referencing C:\Windows\php. ini and that's the
                correct directory.
                >
                Here are the mysqli settings in my php.ini.
                >
                [MySQLi]
                >
                ; Maximum number of links. -1 means no limit.
                mysqli.max_link s = -1
                >
                ; Default port number for mysqli_connect( ). If unset, mysqli_connect( ) will
                use
                ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                ; compile-time value defined MYSQL_PORT (in that order). Win32 will only
                look
                ; at MYSQL_PORT.
                mysqli.default_ port = 3306
                >
                ; Default socket name for local MySQL connects. If empty, uses the built-in
                ; MySQL defaults.
                mysqli.default_ socket =
                >
                ; Default host for mysql_connect() (doesn't apply in safe mode).
                mysqli.default_ host =
                >
                ; Default user for mysql_connect() (doesn't apply in safe mode).
                mysqli.default_ user =
                >
                ; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                ; Note that this is generally a *bad* idea to store passwords in this file.
                ; *Any* user with PHP access can run 'echo get_cfg_var("my sqli.default_pw ")
                ; and reveal this password! And of course, any users with read access to
                this
                ; file will be able to reveal the password as well.
                mysqli.default_ pw =
                >
                ; Allow or prevent reconnect
                mysqli.reconnec t = Off
                >
                >
                Do you have ext=extension=p hp_mysqli.dll in your php.ini?

                --
                =============== ===
                Remove the "x" from my email address
                Jerry Stuckle
                JDS Computer Training Corp.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                • Bruce A. Julseth

                  #9
                  Re: MySQL connect failure


                  "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                  news:fICdnY7P1c lJ8J3bnZ2dnUVZ_ vvinZ2d@comcast .com...
                  Bruce A. Julseth wrote:
                  >"Erwin Moller"
                  ><since_humans_ read_this_I_am_ spammed_too_muc h@spamyourself. comwrote in
                  >message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                  >>Bruce A. Julseth wrote:
                  >>>
                  >>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                  >>>news:IamdnTL NMrgA02LYnZ2dnU VZ_oLinZ2d@comc ast.com...
                  >>>>Bruce A. Julseth wrote:
                  >>>>>"Jeff" <jeff@quixion.n etwrote in message
                  >>>>>news:11743 44779.712020.25 8000@p15g2000hs d.googlegroups. com...
                  >>>>>>Get rid of the @ in front of the $db = new mysqli( ...
                  >>>>>>>
                  >>>>>>That is suppressing any errors on that line of code. Then it should
                  >>>>>>show you in your browser what the error is and then we can help you
                  >>>>>>further .
                  >>>>>>>
                  >>>>>>Also, you can include $Database as the 4th parameter in your mysqli
                  >>>>>>construct or to connect to that specific database.
                  >>>>>>>
                  >>>>>Okay, I now have
                  >>>>>>
                  >>>>> $Host = "localhost" ;
                  >>>>> $User = "Fred";
                  >>>>> $Database = "house";
                  >>>>> $Password = "mypw"
                  >>>>>>
                  >>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
                  >>>>>/>"
                  >>>>> .
                  >>>>>$Databas e;
                  >>>>>>
                  >>>>> $db = new mysqli($Host, $User, $Password);
                  >>>>>>
                  >>>>> echo "Connection is " . mysqli_connect_ errno();
                  >>>>>>
                  >>>>>I didn't add the database to the mysqli parameter list.
                  >>>>>>
                  >>>>>I still never got to the 2nd echo statement. Firefox gives me a
                  >>>>>"done"
                  >>>>>in the lower left corner. The "mysqli" is the very first MySQL
                  >>>>>command I
                  >>>>>execute in my program. Do I need "Create" or "instantiat e" something
                  >>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                  >>>>>[I'm
                  >>>>>not sure what version. How can I find out?]
                  >>>>>>
                  >>>>>>
                  >>>>>>
                  >>>>Add this to the beginning of your script:
                  >>>>>
                  >>>>error_repor ting(E_ALL);
                  >>>>ini_set("di splay_errors", "1");
                  >>>>>
                  >>>>And see what error messages you get. Or check your PHP error log
                  >>>>(which
                  >>>>may be in the Apache log).
                  >>>>>
                  >>>>--
                  >>>>=========== =======
                  >>>>Remove the "x" from my email address
                  >>>>Jerry Stuckle
                  >>>>JDS Computer Training Corp.
                  >>>>jstucklex@attgl obal.net
                  >>>>=========== =======
                  >>>Adding the above code gave the error message:
                  >>>>
                  >>>Fatal error: Class 'mysqli' not found in
                  >>>C:\Inetpub\w wwroot\Serenade HOA\php\functio ns.php on line 47
                  >>>>
                  >>>This implies to me that I have a configuration problem. What should I
                  >>>look
                  >>>for.
                  >>>>
                  >>>My php.ini is in my C:\windows directory.:
                  >>>I have extension_dir = "c:/php5/ext"
                  >>>>
                  >>>What else should I check?
                  >>search for mysqli in your php.ini and comment it in.
                  >>Make sure you have the file in a place where PHP looks.
                  >>>
                  >>Next thing to do is running phpinfo() and see if it finds and loads
                  >>mysqli.
                  >>>
                  >>Good luck.
                  >>>
                  >>Regards,
                  >>Erwin Moller
                  >>>
                  >>>Thanks..
                  >>
                  >I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                  >reference to mysqli. I am referencing C:\Windows\php. ini and that's the
                  >correct directory.
                  >>
                  >Here are the mysqli settings in my php.ini.
                  >>
                  >[MySQLi]
                  >>
                  >; Maximum number of links. -1 means no limit.
                  >mysqli.max_lin ks = -1
                  >>
                  >; Default port number for mysqli_connect( ). If unset, mysqli_connect( )
                  >will use
                  >; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                  >; compile-time value defined MYSQL_PORT (in that order). Win32 will only
                  >look
                  >; at MYSQL_PORT.
                  >mysqli.default _port = 3306
                  >>
                  >; Default socket name for local MySQL connects. If empty, uses the
                  >built-in
                  >; MySQL defaults.
                  >mysqli.default _socket =
                  >>
                  >; Default host for mysql_connect() (doesn't apply in safe mode).
                  >mysqli.default _host =
                  >>
                  >; Default user for mysql_connect() (doesn't apply in safe mode).
                  >mysqli.default _user =
                  >>
                  >; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                  >; Note that this is generally a *bad* idea to store passwords in this
                  >file.
                  >; *Any* user with PHP access can run 'echo
                  >get_cfg_var("m ysqli.default_p w")
                  >; and reveal this password! And of course, any users with read access to
                  >this
                  >; file will be able to reveal the password as well.
                  >mysqli.default _pw =
                  >>
                  >; Allow or prevent reconnect
                  >mysqli.reconne ct = Off
                  >
                  Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                  >
                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===
                  extension=php_m ysqli.dll is set

                  extension=php_m ysql.dll is also set. Should I remove that?


                  Comment

                  • Jerry Stuckle

                    #10
                    Re: MySQL connect failure

                    Bruce A. Pulse's wrote:
                    "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                    news:fICdnY7P1c lJ8J3bnZ2dnUVZ_ vvinZ2d@comcast .com...
                    >Bruce A. Julseth wrote:
                    >>"Erwin Moller"
                    >><since_humans _read_this_I_am _spammed_too_mu ch@spamyourself .comwrote in
                    >>message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                    >>>Bruce A. Julseth wrote:
                    >>>>
                    >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                    >>>>news:IamdnT LNMrgA02LYnZ2dn UVZ_oLinZ2d@com cast.com...
                    >>>>>Bruce A. Julseth wrote:
                    >>>>>>"Jeff" <jeff@quixion.n etwrote in message
                    >>>>>>news:1174 344779.712020.2 58000@p15g2000h sd.googlegroups .com...
                    >>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
                    >>>>>>>>
                    >>>>>>>That is suppressing any errors on that line of code. Then it should
                    >>>>>>>show you in your browser what the error is and then we can help you
                    >>>>>>>furthe r.
                    >>>>>>>>
                    >>>>>>>Also, you can include $Database as the 4th parameter in your mysqli
                    >>>>>>>construc tor to connect to that specific database.
                    >>>>>>>>
                    >>>>>>Okay, I now have
                    >>>>>>>
                    >>>>>> $Host = "localhost" ;
                    >>>>>> $User = "Fred";
                    >>>>>> $Database = "house";
                    >>>>>> $Password = "mypw"
                    >>>>>>>
                    >>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
                    >>>>>>/>"
                    >>>>>> .
                    >>>>>>$Database ;
                    >>>>>>>
                    >>>>>> $db = new mysqli($Host, $User, $Password);
                    >>>>>>>
                    >>>>>> echo "Connection is " . mysqli_connect_ errno();
                    >>>>>>>
                    >>>>>>I didn't add the database to the mysqli parameter list.
                    >>>>>>>
                    >>>>>>I still never got to the 2nd echo statement. Firefox gives me a
                    >>>>>>"done"
                    >>>>>>in the lower left corner. The "mysqli" is the very first MySQL
                    >>>>>>command I
                    >>>>>>execute in my program. Do I need "Create" or "instantiat e" something
                    >>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                    >>>>>>[I'm
                    >>>>>>not sure what version. How can I find out?]
                    >>>>>>>
                    >>>>>>>
                    >>>>>>>
                    >>>>>Add this to the beginning of your script:
                    >>>>>>
                    >>>>>error_repo rting(E_ALL);
                    >>>>>ini_set("d isplay_errors", "1");
                    >>>>>>
                    >>>>>And see what error messages you get. Or check your PHP error log
                    >>>>>(which
                    >>>>>may be in the Apache log).
                    >>>>>>
                    >>>>>--
                    >>>>>========== ========
                    >>>>>Remove the "x" from my email address
                    >>>>>Jerry Stuckle
                    >>>>>JDS Computer Training Corp.
                    >>>>>jstucklex@attgl obal.net
                    >>>>>========== ========
                    >>>>Adding the above code gave the error message:
                    >>>>>
                    >>>>Fatal error: Class 'mysqli' not found in
                    >>>>C:\Inetpub\ wwwroot\Serenad eHOA\php\functi ons.php on line 47
                    >>>>>
                    >>>>This implies to me that I have a configuration problem. What should I
                    >>>>look
                    >>>>for.
                    >>>>>
                    >>>>My php.ini is in my C:\windows directory.:
                    >>>>I have extension_dir = "c:/php5/ext"
                    >>>>>
                    >>>>What else should I check?
                    >>>search for mysqli in your php.ini and comment it in.
                    >>>Make sure you have the file in a place where PHP looks.
                    >>>>
                    >>>Next thing to do is running phpinfo() and see if it finds and loads
                    >>>mysqli.
                    >>>>
                    >>>Good luck.
                    >>>>
                    >>>Regards,
                    >>>Erwin Moller
                    >>>>
                    >>>>Thanks..
                    >>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                    >>reference to mysqli. I am referencing C:\Windows\php. ini and that's the
                    >>correct directory.
                    >>>
                    >>Here are the mysqli settings in my php.ini.
                    >>>
                    >>[MySQLi]
                    >>>
                    >>; Maximum number of links. -1 means no limit.
                    >>mysqli.max_li nks = -1
                    >>>
                    >>; Default port number for mysqli_connect( ). If unset, mysqli_connect( )
                    >>will use
                    >>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                    >>; compile-time value defined MYSQL_PORT (in that order). Win32 will only
                    >>look
                    >>; at MYSQL_PORT.
                    >>mysqli.defaul t_port = 3306
                    >>>
                    >>; Default socket name for local MySQL connects. If empty, uses the
                    >>built-in
                    >>; MySQL defaults.
                    >>mysqli.defaul t_socket =
                    >>>
                    >>; Default host for mysql_connect() (doesn't apply in safe mode).
                    >>mysqli.defaul t_host =
                    >>>
                    >>; Default user for mysql_connect() (doesn't apply in safe mode).
                    >>mysqli.defaul t_user =
                    >>>
                    >>; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                    >>; Note that this is generally a *bad* idea to store passwords in this
                    >>file.
                    >>; *Any* user with PHP access can run 'echo
                    >>get_cfg_var(" mysqli.default_ pw")
                    >>; and reveal this password! And of course, any users with read access to
                    >>this
                    >>; file will be able to reveal the password as well.
                    >>mysqli.defaul t_pw =
                    >>>
                    >>; Allow or prevent reconnect
                    >>mysqli.reconn ect = Off
                    >Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                    >>
                    >--
                    >============== ====
                    >Remove the "x" from my email address
                    >Jerry Stuckle
                    >JDS Computer Training Corp.
                    >jstucklex@attgl obal.net
                    >============== ====
                    >
                    extension=php_m ysqli.dll is set
                    >
                    extension=php_m ysql.dll is also set. Should I remove that?
                    >
                    >
                    No, it's perfectly fine to have both of them. Are you sure you're
                    editing the correct php.ini file? Where does phpinfo() say it's getting
                    it from?

                    Does phpinfo() show you're loading the mysql extension? If neither are
                    being loaded, chances are there's a problem with the location of your
                    libmysqlclient. dll file (probably the location). But if the mysql
                    extension is being loaded, then you should be able to get to the MySQL libs.



                    --
                    =============== ===
                    Remove the "x" from my email address
                    Jerry Stuckle
                    JDS Computer Training Corp.
                    jstucklex@attgl obal.net
                    =============== ===

                    Comment

                    • Bruce A. Julseth

                      #11
                      Re: MySQL connect failure


                      "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                      news:TOqdnQaFie r9jJzbnZ2dnUVZ_ vmqnZ2d@comcast .com...
                      Bruce A. Pulse's wrote:
                      >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                      >news:fICdnY7P1 clJ8J3bnZ2dnUVZ _vvinZ2d@comcas t.com...
                      >>Bruce A. Julseth wrote:
                      >>>"Erwin Moller"
                      >>><since_human s_read_this_I_a m_spammed_too_m uch@spamyoursel f.comwrote
                      >>>in message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                      >>>>Bruce A. Julseth wrote:
                      >>>>>
                      >>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                      >>>>>news:Iamdn TLNMrgA02LYnZ2d nUVZ_oLinZ2d@co mcast.com...
                      >>>>>>Bruce A. Julseth wrote:
                      >>>>>>>"Jeff" <jeff@quixion.n etwrote in message
                      >>>>>>>news:117 4344779.712020. 258000@p15g2000 hsd.googlegroup s.com...
                      >>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
                      >>>>>>>>>
                      >>>>>>>>That is suppressing any errors on that line of code. Then it
                      >>>>>>>>shoul d
                      >>>>>>>>show you in your browser what the error is and then we can help
                      >>>>>>>>you
                      >>>>>>>>further .
                      >>>>>>>>>
                      >>>>>>>>Also, you can include $Database as the 4th parameter in your
                      >>>>>>>>mysql i
                      >>>>>>>>constru ctor to connect to that specific database.
                      >>>>>>>>>
                      >>>>>>>Okay, I now have
                      >>>>>>>>
                      >>>>>>> $Host = "localhost" ;
                      >>>>>>> $User = "Fred";
                      >>>>>>> $Database = "house";
                      >>>>>>> $Password = "mypw"
                      >>>>>>>>
                      >>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
                      >>>>>>>/>"
                      >>>>>>> .
                      >>>>>>>$Databas e;
                      >>>>>>>>
                      >>>>>>> $db = new mysqli($Host, $User, $Password);
                      >>>>>>>>
                      >>>>>>> echo "Connection is " . mysqli_connect_ errno();
                      >>>>>>>>
                      >>>>>>>I didn't add the database to the mysqli parameter list.
                      >>>>>>>>
                      >>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
                      >>>>>>>"done"
                      >>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
                      >>>>>>>comman d I
                      >>>>>>>execut e in my program. Do I need "Create" or "instantiat e"
                      >>>>>>>somethin g
                      >>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                      >>>>>>>[I'm
                      >>>>>>>not sure what version. How can I find out?]
                      >>>>>>>>
                      >>>>>>>>
                      >>>>>>>>
                      >>>>>>Add this to the beginning of your script:
                      >>>>>>>
                      >>>>>>error_rep orting(E_ALL);
                      >>>>>>ini_set(" display_errors" , "1");
                      >>>>>>>
                      >>>>>>And see what error messages you get. Or check your PHP error log
                      >>>>>>(which
                      >>>>>>may be in the Apache log).
                      >>>>>>>
                      >>>>>>--
                      >>>>>>========= =========
                      >>>>>>Remove the "x" from my email address
                      >>>>>>Jerry Stuckle
                      >>>>>>JDS Computer Training Corp.
                      >>>>>>jstucklex@attgl obal.net
                      >>>>>>========= =========
                      >>>>>Adding the above code gave the error message:
                      >>>>>>
                      >>>>>Fatal error: Class 'mysqli' not found in
                      >>>>>C:\Inetpub \wwwroot\Serena deHOA\php\funct ions.php on line 47
                      >>>>>>
                      >>>>>This implies to me that I have a configuration problem. What should I
                      >>>>>look
                      >>>>>for.
                      >>>>>>
                      >>>>>My php.ini is in my C:\windows directory.:
                      >>>>>I have extension_dir = "c:/php5/ext"
                      >>>>>>
                      >>>>>What else should I check?
                      >>>>search for mysqli in your php.ini and comment it in.
                      >>>>Make sure you have the file in a place where PHP looks.
                      >>>>>
                      >>>>Next thing to do is running phpinfo() and see if it finds and loads
                      >>>>mysqli.
                      >>>>>
                      >>>>Good luck.
                      >>>>>
                      >>>>Regards,
                      >>>>Erwin Moller
                      >>>>>
                      >>>>>Thanks..
                      >>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                      >>>reference to mysqli. I am referencing C:\Windows\php. ini and that's
                      >>>the correct directory.
                      >>>>
                      >>>Here are the mysqli settings in my php.ini.
                      >>>>
                      >>>[MySQLi]
                      >>>>
                      >>>; Maximum number of links. -1 means no limit.
                      >>>mysqli.max_l inks = -1
                      >>>>
                      >>>; Default port number for mysqli_connect( ). If unset, mysqli_connect( )
                      >>>will use
                      >>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                      >>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
                      >>>only look
                      >>>; at MYSQL_PORT.
                      >>>mysqli.defau lt_port = 3306
                      >>>>
                      >>>; Default socket name for local MySQL connects. If empty, uses the
                      >>>built-in
                      >>>; MySQL defaults.
                      >>>mysqli.defau lt_socket =
                      >>>>
                      >>>; Default host for mysql_connect() (doesn't apply in safe mode).
                      >>>mysqli.defau lt_host =
                      >>>>
                      >>>; Default user for mysql_connect() (doesn't apply in safe mode).
                      >>>mysqli.defau lt_user =
                      >>>>
                      >>>; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                      >>>; Note that this is generally a *bad* idea to store passwords in this
                      >>>file.
                      >>>; *Any* user with PHP access can run 'echo
                      >>>get_cfg_var( "mysqli.default _pw")
                      >>>; and reveal this password! And of course, any users with read access
                      >>>to this
                      >>>; file will be able to reveal the password as well.
                      >>>mysqli.defau lt_pw =
                      >>>>
                      >>>; Allow or prevent reconnect
                      >>>mysqli.recon nect = Off
                      >>Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                      >>>
                      >>--
                      >>============= =====
                      >>Remove the "x" from my email address
                      >>Jerry Stuckle
                      >>JDS Computer Training Corp.
                      >>jstucklex@attgl obal.net
                      >>============= =====
                      >>
                      >extension=php_ mysqli.dll is set
                      >>
                      >extension=php_ mysql.dll is also set. Should I remove that?
                      >
                      No, it's perfectly fine to have both of them. Are you sure you're editing
                      the correct php.ini file? Where does phpinfo() say it's getting it from?
                      >
                      Does phpinfo() show you're loading the mysql extension? If neither are
                      being loaded, chances are there's a problem with the location of your
                      libmysqlclient. dll file (probably the location). But if the mysql
                      extension is being loaded, then you should be able to get to the MySQL
                      libs.
                      >
                      >
                      >
                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===
                      php.ini is coming from C:\Windows.

                      Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
                      it. I have sent you a screen shot of the phpinfo.php..

                      Thanks



                      Comment

                      • Jerry Stuckle

                        #12
                        Re: MySQL connect failure

                        Bruce A. Julseth wrote:
                        "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                        news:TOqdnQaFie r9jJzbnZ2dnUVZ_ vmqnZ2d@comcast .com...
                        >Bruce A. Pulse's wrote:
                        >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                        >>news:fICdnY7P 1clJ8J3bnZ2dnUV Z_vvinZ2d@comca st.com...
                        >>>Bruce A. Julseth wrote:
                        >>>>"Erwin Moller"
                        >>>><since_huma ns_read_this_I_ am_spammed_too_ much@spamyourse lf.comwrote
                        >>>>in message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                        >>>>>Bruce A. Julseth wrote:
                        >>>>>>
                        >>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                        >>>>>>news:Iamd nTLNMrgA02LYnZ2 dnUVZ_oLinZ2d@c omcast.com...
                        >>>>>>>Bruce A. Julseth wrote:
                        >>>>>>>>"Jeff " <jeff@quixion.n etwrote in message
                        >>>>>>>>news:11 74344779.712020 .258000@p15g200 0hsd.googlegrou ps.com...
                        >>>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
                        >>>>>>>>>>
                        >>>>>>>>>That is suppressing any errors on that line of code. Then it
                        >>>>>>>>>shou ld
                        >>>>>>>>>show you in your browser what the error is and then we can help
                        >>>>>>>>>you
                        >>>>>>>>>furthe r.
                        >>>>>>>>>>
                        >>>>>>>>>Also , you can include $Database as the 4th parameter in your
                        >>>>>>>>>mysq li
                        >>>>>>>>>constr uctor to connect to that specific database.
                        >>>>>>>>>>
                        >>>>>>>>Okay, I now have
                        >>>>>>>>>
                        >>>>>>>> $Host = "localhost" ;
                        >>>>>>>> $User = "Fred";
                        >>>>>>>> $Database = "house";
                        >>>>>>>> $Password = "mypw"
                        >>>>>>>>>
                        >>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
                        >>>>>>>>/>"
                        >>>>>>>> .
                        >>>>>>>>$Databa se;
                        >>>>>>>>>
                        >>>>>>>> $db = new mysqli($Host, $User, $Password);
                        >>>>>>>>>
                        >>>>>>>> echo "Connection is " . mysqli_connect_ errno();
                        >>>>>>>>>
                        >>>>>>>>I didn't add the database to the mysqli parameter list.
                        >>>>>>>>>
                        >>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
                        >>>>>>>>"done "
                        >>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
                        >>>>>>>>comma nd I
                        >>>>>>>>execu te in my program. Do I need "Create" or "instantiat e"
                        >>>>>>>>somethi ng
                        >>>>>>>>first ? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                        >>>>>>>>[I'm
                        >>>>>>>>not sure what version. How can I find out?]
                        >>>>>>>>>
                        >>>>>>>>>
                        >>>>>>>>>
                        >>>>>>>Add this to the beginning of your script:
                        >>>>>>>>
                        >>>>>>>error_re porting(E_ALL);
                        >>>>>>>ini_set( "display_errors ", "1");
                        >>>>>>>>
                        >>>>>>>And see what error messages you get. Or check your PHP error log
                        >>>>>>>(which
                        >>>>>>>may be in the Apache log).
                        >>>>>>>>
                        >>>>>>>--
                        >>>>>>>======== ==========
                        >>>>>>>Remove the "x" from my email address
                        >>>>>>>Jerry Stuckle
                        >>>>>>>JDS Computer Training Corp.
                        >>>>>>>jstucklex@attgl obal.net
                        >>>>>>>======== ==========
                        >>>>>>Adding the above code gave the error message:
                        >>>>>>>
                        >>>>>>Fatal error: Class 'mysqli' not found in
                        >>>>>>C:\Inetpu b\wwwroot\Seren adeHOA\php\func tions.php on line 47
                        >>>>>>>
                        >>>>>>This implies to me that I have a configuration problem. What should I
                        >>>>>>look
                        >>>>>>for.
                        >>>>>>>
                        >>>>>>My php.ini is in my C:\windows directory.:
                        >>>>>>I have extension_dir = "c:/php5/ext"
                        >>>>>>>
                        >>>>>>What else should I check?
                        >>>>>search for mysqli in your php.ini and comment it in.
                        >>>>>Make sure you have the file in a place where PHP looks.
                        >>>>>>
                        >>>>>Next thing to do is running phpinfo() and see if it finds and loads
                        >>>>>mysqli.
                        >>>>>>
                        >>>>>Good luck.
                        >>>>>>
                        >>>>>Regards,
                        >>>>>Erwin Moller
                        >>>>>>
                        >>>>>>Thanks. .
                        >>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                        >>>>reference to mysqli. I am referencing C:\Windows\php. ini and that's
                        >>>>the correct directory.
                        >>>>>
                        >>>>Here are the mysqli settings in my php.ini.
                        >>>>>
                        >>>>[MySQLi]
                        >>>>>
                        >>>>; Maximum number of links. -1 means no limit.
                        >>>>mysqli.max_ links = -1
                        >>>>>
                        >>>>; Default port number for mysqli_connect( ). If unset, mysqli_connect( )
                        >>>>will use
                        >>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                        >>>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
                        >>>>only look
                        >>>>; at MYSQL_PORT.
                        >>>>mysqli.defa ult_port = 3306
                        >>>>>
                        >>>>; Default socket name for local MySQL connects. If empty, uses the
                        >>>>built-in
                        >>>>; MySQL defaults.
                        >>>>mysqli.defa ult_socket =
                        >>>>>
                        >>>>; Default host for mysql_connect() (doesn't apply in safe mode).
                        >>>>mysqli.defa ult_host =
                        >>>>>
                        >>>>; Default user for mysql_connect() (doesn't apply in safe mode).
                        >>>>mysqli.defa ult_user =
                        >>>>>
                        >>>>; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                        >>>>; Note that this is generally a *bad* idea to store passwords in this
                        >>>>file.
                        >>>>; *Any* user with PHP access can run 'echo
                        >>>>get_cfg_var ("mysqli.defaul t_pw")
                        >>>>; and reveal this password! And of course, any users with read access
                        >>>>to this
                        >>>>; file will be able to reveal the password as well.
                        >>>>mysqli.defa ult_pw =
                        >>>>>
                        >>>>; Allow or prevent reconnect
                        >>>>mysqli.reco nnect = Off
                        >>>Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                        >>>>
                        >>>--
                        >>>============ ======
                        >>>Remove the "x" from my email address
                        >>>Jerry Stuckle
                        >>>JDS Computer Training Corp.
                        >>>jstucklex@attgl obal.net
                        >>>============ ======
                        >>extension=php _mysqli.dll is set
                        >>>
                        >>extension=php _mysql.dll is also set. Should I remove that?
                        >No, it's perfectly fine to have both of them. Are you sure you're editing
                        >the correct php.ini file? Where does phpinfo() say it's getting it from?
                        >>
                        >Does phpinfo() show you're loading the mysql extension? If neither are
                        >being loaded, chances are there's a problem with the location of your
                        >libmysqlclient .dll file (probably the location). But if the mysql
                        >extension is being loaded, then you should be able to get to the MySQL
                        >libs.
                        >>
                        >>
                        >>
                        >--
                        >============== ====
                        >Remove the "x" from my email address
                        >Jerry Stuckle
                        >JDS Computer Training Corp.
                        >jstucklex@attgl obal.net
                        >============== ====
                        >
                        php.ini is coming from C:\Windows.
                        >
                        Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
                        it. I have sent you a screen shot of the phpinfo.php..
                        >
                        Thanks
                        >
                        >
                        >
                        OK, that means it isn't finding something it needs for mysql - probably
                        libmysql.dll. Ensure your mysql\bin directory is in your PATH or
                        libmysql.dll is in a directory in your PATH.

                        And sorry - I don't have a screen shot handy - but if it were there
                        you'd see it.

                        --
                        =============== ===
                        Remove the "x" from my email address
                        Jerry Stuckle
                        JDS Computer Training Corp.
                        jstucklex@attgl obal.net
                        =============== ===

                        Comment

                        • Bruce A. Julseth

                          #13
                          Re: MySQL connect failure


                          "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                          news:rJOdndH_aO Zq1pzbnZ2dnUVZ_ qemnZ2d@comcast .com...
                          Bruce A. Julseth wrote:
                          >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                          >news:TOqdnQaFi er9jJzbnZ2dnUVZ _vmqnZ2d@comcas t.com...
                          >>Bruce A. Pulse's wrote:
                          >>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                          >>>news:fICdnY7 P1clJ8J3bnZ2dnU VZ_vvinZ2d@comc ast.com...
                          >>>>Bruce A. Julseth wrote:
                          >>>>>"Erwin Moller"
                          >>>>><since_hum ans_read_this_I _am_spammed_too _much@spamyours elf.comwrote
                          >>>>>in message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                          >>>>>>Bruce A. Julseth wrote:
                          >>>>>>>
                          >>>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                          >>>>>>>news:Iam dnTLNMrgA02LYnZ 2dnUVZ_oLinZ2d@ comcast.com...
                          >>>>>>>>Bruce A. Julseth wrote:
                          >>>>>>>>>"Jef f" <jeff@quixion.n etwrote in message
                          >>>>>>>>>news:1 174344779.71202 0.258000@p15g20 00hsd.googlegro ups.com...
                          >>>>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
                          >>>>>>>>>>>
                          >>>>>>>>>>Tha t is suppressing any errors on that line of code. Then it
                          >>>>>>>>>>shoul d
                          >>>>>>>>>>sho w you in your browser what the error is and then we can help
                          >>>>>>>>>>you
                          >>>>>>>>>>furth er.
                          >>>>>>>>>>>
                          >>>>>>>>>>Als o, you can include $Database as the 4th parameter in your
                          >>>>>>>>>>mysql i
                          >>>>>>>>>>const ructor to connect to that specific database.
                          >>>>>>>>>>>
                          >>>>>>>>>Okay , I now have
                          >>>>>>>>>>
                          >>>>>>>>> $Host = "localhost" ;
                          >>>>>>>>> $User = "Fred";
                          >>>>>>>>> $Database = "house";
                          >>>>>>>>> $Password = "mypw"
                          >>>>>>>>>>
                          >>>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
                          >>>>>>>>>"<br />"
                          >>>>>>>>> .
                          >>>>>>>>>$Datab ase;
                          >>>>>>>>>>
                          >>>>>>>>> $db = new mysqli($Host, $User, $Password);
                          >>>>>>>>>>
                          >>>>>>>>> echo "Connection is " . mysqli_connect_ errno();
                          >>>>>>>>>>
                          >>>>>>>>>I didn't add the database to the mysqli parameter list.
                          >>>>>>>>>>
                          >>>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
                          >>>>>>>>>"don e"
                          >>>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
                          >>>>>>>>>comman d I
                          >>>>>>>>>execut e in my program. Do I need "Create" or "instantiat e"
                          >>>>>>>>>someth ing
                          >>>>>>>>>firs t? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                          >>>>>>>>>[I'm
                          >>>>>>>>>not sure what version. How can I find out?]
                          >>>>>>>>>>
                          >>>>>>>>>>
                          >>>>>>>>>>
                          >>>>>>>>Add this to the beginning of your script:
                          >>>>>>>>>
                          >>>>>>>>error_r eporting(E_ALL) ;
                          >>>>>>>>ini_set ("display_error s", "1");
                          >>>>>>>>>
                          >>>>>>>>And see what error messages you get. Or check your PHP error log
                          >>>>>>>>(whic h
                          >>>>>>>>may be in the Apache log).
                          >>>>>>>>>
                          >>>>>>>>--
                          >>>>>>>>======= ===========
                          >>>>>>>>Remov e the "x" from my email address
                          >>>>>>>>Jerry Stuckle
                          >>>>>>>>JDS Computer Training Corp.
                          >>>>>>>>jstucklex@attgl obal.net
                          >>>>>>>>======= ===========
                          >>>>>>>Adding the above code gave the error message:
                          >>>>>>>>
                          >>>>>>>Fatal error: Class 'mysqli' not found in
                          >>>>>>>C:\Inetp ub\wwwroot\Sere nadeHOA\php\fun ctions.php on line 47
                          >>>>>>>>
                          >>>>>>>This implies to me that I have a configuration problem. What should
                          >>>>>>>I look
                          >>>>>>>for.
                          >>>>>>>>
                          >>>>>>>My php.ini is in my C:\windows directory.:
                          >>>>>>>I have extension_dir = "c:/php5/ext"
                          >>>>>>>>
                          >>>>>>>What else should I check?
                          >>>>>>search for mysqli in your php.ini and comment it in.
                          >>>>>>Make sure you have the file in a place where PHP looks.
                          >>>>>>>
                          >>>>>>Next thing to do is running phpinfo() and see if it finds and loads
                          >>>>>>mysqli.
                          >>>>>>>
                          >>>>>>Good luck.
                          >>>>>>>
                          >>>>>>Regards ,
                          >>>>>>Erwin Moller
                          >>>>>>>
                          >>>>>>>Thanks ..
                          >>>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                          >>>>>referenc e to mysqli. I am referencing C:\Windows\php. ini and that's
                          >>>>>the correct directory.
                          >>>>>>
                          >>>>>Here are the mysqli settings in my php.ini.
                          >>>>>>
                          >>>>>[MySQLi]
                          >>>>>>
                          >>>>>; Maximum number of links. -1 means no limit.
                          >>>>>mysqli.max _links = -1
                          >>>>>>
                          >>>>>; Default port number for mysqli_connect( ). If unset,
                          >>>>>mysqli_con nect() will use
                          >>>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                          >>>>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
                          >>>>>only look
                          >>>>>; at MYSQL_PORT.
                          >>>>>mysqli.def ault_port = 3306
                          >>>>>>
                          >>>>>; Default socket name for local MySQL connects. If empty, uses the
                          >>>>>built-in
                          >>>>>; MySQL defaults.
                          >>>>>mysqli.def ault_socket =
                          >>>>>>
                          >>>>>; Default host for mysql_connect() (doesn't apply in safe mode).
                          >>>>>mysqli.def ault_host =
                          >>>>>>
                          >>>>>; Default user for mysql_connect() (doesn't apply in safe mode).
                          >>>>>mysqli.def ault_user =
                          >>>>>>
                          >>>>>; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                          >>>>>; Note that this is generally a *bad* idea to store passwords in this
                          >>>>>file.
                          >>>>>; *Any* user with PHP access can run 'echo
                          >>>>>get_cfg_va r("mysqli.defau lt_pw")
                          >>>>>; and reveal this password! And of course, any users with read
                          >>>>>access to this
                          >>>>>; file will be able to reveal the password as well.
                          >>>>>mysqli.def ault_pw =
                          >>>>>>
                          >>>>>; Allow or prevent reconnect
                          >>>>>mysqli.rec onnect = Off
                          >>>>Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                          >>>>>
                          >>>>--
                          >>>>=========== =======
                          >>>>Remove the "x" from my email address
                          >>>>Jerry Stuckle
                          >>>>JDS Computer Training Corp.
                          >>>>jstucklex@attgl obal.net
                          >>>>=========== =======
                          >>>extension=ph p_mysqli.dll is set
                          >>>>
                          >>>extension=ph p_mysql.dll is also set. Should I remove that?
                          >>No, it's perfectly fine to have both of them. Are you sure you're
                          >>editing the correct php.ini file? Where does phpinfo() say it's getting
                          >>it from?
                          >>>
                          >>Does phpinfo() show you're loading the mysql extension? If neither are
                          >>being loaded, chances are there's a problem with the location of your
                          >>libmysqlclien t.dll file (probably the location). But if the mysql
                          >>extension is being loaded, then you should be able to get to the MySQL
                          >>libs.
                          >>>
                          >>>
                          >>>
                          >>--
                          >>============= =====
                          >>Remove the "x" from my email address
                          >>Jerry Stuckle
                          >>JDS Computer Training Corp.
                          >>jstucklex@attgl obal.net
                          >>============= =====
                          >>
                          >php.ini is coming from C:\Windows.
                          >>
                          >Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
                          >it. I have sent you a screen shot of the phpinfo.php..
                          >>
                          >Thanks
                          >>
                          >>
                          >>
                          >
                          OK, that means it isn't finding something it needs for mysql - probably
                          libmysql.dll. Ensure your mysql\bin directory is in your PATH or
                          libmysql.dll is in a directory in your PATH.
                          >
                          And sorry - I don't have a screen shot handy - but if it were there you'd
                          see it.
                          >
                          --
                          =============== ===
                          Remove the "x" from my email address
                          Jerry Stuckle
                          JDS Computer Training Corp.
                          jstucklex@attgl obal.net
                          =============== ===
                          C:\Program Files\MySQL\MyS QL Server 5.0\bin is in my path. I went to a
                          command line and "Dir"'d this directory to make sure nothing hoaky and the
                          dir worked. libmysql.dll is in this path.

                          BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php as
                          a pdf file. Did you get it?


                          Comment

                          • Jerry Stuckle

                            #14
                            Re: MySQL connect failure

                            Bruce A. Julseth wrote:
                            "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                            news:rJOdndH_aO Zq1pzbnZ2dnUVZ_ qemnZ2d@comcast .com...
                            >Bruce A. Julseth wrote:
                            >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                            >>news:TOqdnQaF ier9jJzbnZ2dnUV Z_vmqnZ2d@comca st.com...
                            >>>Bruce A. Pulse's wrote:
                            >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                            >>>>news:fICdnY 7P1clJ8J3bnZ2dn UVZ_vvinZ2d@com cast.com...
                            >>>>>Bruce A. Julseth wrote:
                            >>>>>>"Erwin Moller"
                            >>>>>><since_hu mans_read_this_ I_am_spammed_to o_much@spamyour self.comwrote
                            >>>>>>in message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                            >>>>>>>Bruce A. Julseth wrote:
                            >>>>>>>>
                            >>>>>>>>"Jerr y Stuckle" <jstucklex@attg lobal.netwrote in message
                            >>>>>>>>news:Ia mdnTLNMrgA02LYn Z2dnUVZ_oLinZ2d @comcast.com...
                            >>>>>>>>>Bruc e A. Julseth wrote:
                            >>>>>>>>>>"Jeff " <jeff@quixion.n etwrote in message
                            >>>>>>>>>>news: 1174344779.7120 20.258000@p15g2 000hsd.googlegr oups.com...
                            >>>>>>>>>>>Ge t rid of the @ in front of the $db = new mysqli( ...
                            >>>>>>>>>>>>
                            >>>>>>>>>>>Th at is suppressing any errors on that line of code. Then it
                            >>>>>>>>>>>shou ld
                            >>>>>>>>>>>sh ow you in your browser what the error is and then we can help
                            >>>>>>>>>>>yo u
                            >>>>>>>>>>>furt her.
                            >>>>>>>>>>>>
                            >>>>>>>>>>>Also , you can include $Database as the 4th parameter in your
                            >>>>>>>>>>>mysq li
                            >>>>>>>>>>>cons tructor to connect to that specific database.
                            >>>>>>>>>>>>
                            >>>>>>>>>>Oka y, I now have
                            >>>>>>>>>>>
                            >>>>>>>>>> $Host = "localhost" ;
                            >>>>>>>>>> $User = "Fred";
                            >>>>>>>>>> $Database = "house";
                            >>>>>>>>>> $Password = "mypw"
                            >>>>>>>>>>>
                            >>>>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
                            >>>>>>>>>>"<b r />"
                            >>>>>>>>>> .
                            >>>>>>>>>>$Data base;
                            >>>>>>>>>>>
                            >>>>>>>>>> $db = new mysqli($Host, $User, $Password);
                            >>>>>>>>>>>
                            >>>>>>>>>> echo "Connection is " . mysqli_connect_ errno();
                            >>>>>>>>>>>
                            >>>>>>>>>>I didn't add the database to the mysqli parameter list.
                            >>>>>>>>>>>
                            >>>>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
                            >>>>>>>>>>"done "
                            >>>>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
                            >>>>>>>>>>comma nd I
                            >>>>>>>>>>execu te in my program. Do I need "Create" or "instantiat e"
                            >>>>>>>>>>somet hing
                            >>>>>>>>>>first ? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                            >>>>>>>>>>[I'm
                            >>>>>>>>>>not sure what version. How can I find out?]
                            >>>>>>>>>>>
                            >>>>>>>>>>>
                            >>>>>>>>>>>
                            >>>>>>>>>Add this to the beginning of your script:
                            >>>>>>>>>>
                            >>>>>>>>>error_ reporting(E_ALL );
                            >>>>>>>>>ini_se t("display_erro rs", "1");
                            >>>>>>>>>>
                            >>>>>>>>>And see what error messages you get. Or check your PHP error log
                            >>>>>>>>>(whi ch
                            >>>>>>>>>may be in the Apache log).
                            >>>>>>>>>>
                            >>>>>>>>>--
                            >>>>>>>>>====== ============
                            >>>>>>>>>Remo ve the "x" from my email address
                            >>>>>>>>>Jerr y Stuckle
                            >>>>>>>>>JDS Computer Training Corp.
                            >>>>>>>>>jstucklex@attgl obal.net
                            >>>>>>>>>====== ============
                            >>>>>>>>Addin g the above code gave the error message:
                            >>>>>>>>>
                            >>>>>>>>Fatal error: Class 'mysqli' not found in
                            >>>>>>>>C:\Inet pub\wwwroot\Ser enadeHOA\php\fu nctions.php on line 47
                            >>>>>>>>>
                            >>>>>>>>This implies to me that I have a configuration problem. What should
                            >>>>>>>>I look
                            >>>>>>>>for.
                            >>>>>>>>>
                            >>>>>>>>My php.ini is in my C:\windows directory.:
                            >>>>>>>>I have extension_dir = "c:/php5/ext"
                            >>>>>>>>>
                            >>>>>>>>What else should I check?
                            >>>>>>>search for mysqli in your php.ini and comment it in.
                            >>>>>>>Make sure you have the file in a place where PHP looks.
                            >>>>>>>>
                            >>>>>>>Next thing to do is running phpinfo() and see if it finds and loads
                            >>>>>>>mysqli .
                            >>>>>>>>
                            >>>>>>>Good luck.
                            >>>>>>>>
                            >>>>>>>Regard s,
                            >>>>>>>Erwin Moller
                            >>>>>>>>
                            >>>>>>>>Thanks. .
                            >>>>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                            >>>>>>referen ce to mysqli. I am referencing C:\Windows\php. ini and that's
                            >>>>>>the correct directory.
                            >>>>>>>
                            >>>>>>Here are the mysqli settings in my php.ini.
                            >>>>>>>
                            >>>>>>[MySQLi]
                            >>>>>>>
                            >>>>>>; Maximum number of links. -1 means no limit.
                            >>>>>>mysqli.ma x_links = -1
                            >>>>>>>
                            >>>>>>; Default port number for mysqli_connect( ). If unset,
                            >>>>>>mysqli_co nnect() will use
                            >>>>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                            >>>>>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
                            >>>>>>only look
                            >>>>>>; at MYSQL_PORT.
                            >>>>>>mysqli.de fault_port = 3306
                            >>>>>>>
                            >>>>>>; Default socket name for local MySQL connects. If empty, uses the
                            >>>>>>built-in
                            >>>>>>; MySQL defaults.
                            >>>>>>mysqli.de fault_socket =
                            >>>>>>>
                            >>>>>>; Default host for mysql_connect() (doesn't apply in safe mode).
                            >>>>>>mysqli.de fault_host =
                            >>>>>>>
                            >>>>>>; Default user for mysql_connect() (doesn't apply in safe mode).
                            >>>>>>mysqli.de fault_user =
                            >>>>>>>
                            >>>>>>; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                            >>>>>>; Note that this is generally a *bad* idea to store passwords in this
                            >>>>>>file.
                            >>>>>>; *Any* user with PHP access can run 'echo
                            >>>>>>get_cfg_v ar("mysqli.defa ult_pw")
                            >>>>>>; and reveal this password! And of course, any users with read
                            >>>>>>access to this
                            >>>>>>; file will be able to reveal the password as well.
                            >>>>>>mysqli.de fault_pw =
                            >>>>>>>
                            >>>>>>; Allow or prevent reconnect
                            >>>>>>mysqli.re connect = Off
                            >>>>>Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                            >>>>>>
                            >>>>>--
                            >>>>>========== ========
                            >>>>>Remove the "x" from my email address
                            >>>>>Jerry Stuckle
                            >>>>>JDS Computer Training Corp.
                            >>>>>jstucklex@attgl obal.net
                            >>>>>========== ========
                            >>>>extension=p hp_mysqli.dll is set
                            >>>>>
                            >>>>extension=p hp_mysql.dll is also set. Should I remove that?
                            >>>No, it's perfectly fine to have both of them. Are you sure you're
                            >>>editing the correct php.ini file? Where does phpinfo() say it's getting
                            >>>it from?
                            >>>>
                            >>>Does phpinfo() show you're loading the mysql extension? If neither are
                            >>>being loaded, chances are there's a problem with the location of your
                            >>>libmysqlclie nt.dll file (probably the location). But if the mysql
                            >>>extension is being loaded, then you should be able to get to the MySQL
                            >>>libs.
                            >>>>
                            >>>>
                            >>>>
                            >>>--
                            >>>============ ======
                            >>>Remove the "x" from my email address
                            >>>Jerry Stuckle
                            >>>JDS Computer Training Corp.
                            >>>jstucklex@attgl obal.net
                            >>>============ ======
                            >>php.ini is coming from C:\Windows.
                            >>>
                            >>Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
                            >>it. I have sent you a screen shot of the phpinfo.php..
                            >>>
                            >>Thanks
                            >>>
                            >>>
                            >>>
                            >OK, that means it isn't finding something it needs for mysql - probably
                            >libmysql.dll . Ensure your mysql\bin directory is in your PATH or
                            >libmysql.dll is in a directory in your PATH.
                            >>
                            >And sorry - I don't have a screen shot handy - but if it were there you'd
                            >see it.
                            >>
                            >--
                            >============== ====
                            >Remove the "x" from my email address
                            >Jerry Stuckle
                            >JDS Computer Training Corp.
                            >jstucklex@attgl obal.net
                            >============== ====
                            >
                            C:\Program Files\MySQL\MyS QL Server 5.0\bin is in my path. I went to a
                            command line and "Dir"'d this directory to make sure nothing hoaky and the
                            dir worked. libmysql.dll is in this path.
                            >
                            BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php as
                            a pdf file. Did you get it?
                            >
                            >
                            Hi, Bruce,

                            I didn't look at every line - but it looks OK.

                            Do you have anything in your Apache error log? The way things are set,
                            any errors should go there.

                            And it's find to have both mysql and mysqli extensions enabled.

                            --
                            =============== ===
                            Remove the "x" from my email address
                            Jerry Stuckle
                            JDS Computer Training Corp.
                            jstucklex@attgl obal.net
                            =============== ===

                            Comment

                            • Jerry Stuckle

                              #15
                              Re: MySQL connect failure

                              Bruce A. Julseth wrote:
                              "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                              news:rJOdndH_aO Zq1pzbnZ2dnUVZ_ qemnZ2d@comcast .com...
                              >Bruce A. Julseth wrote:
                              >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                              >>news:TOqdnQaF ier9jJzbnZ2dnUV Z_vmqnZ2d@comca st.com...
                              >>>Bruce A. Pulse's wrote:
                              >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                              >>>>news:fICdnY 7P1clJ8J3bnZ2dn UVZ_vvinZ2d@com cast.com...
                              >>>>>Bruce A. Julseth wrote:
                              >>>>>>"Erwin Moller"
                              >>>>>><since_hu mans_read_this_ I_am_spammed_to o_much@spamyour self.comwrote
                              >>>>>>in message news:45fff99d$0 $69886$e4fe514c @news.xs4all.nl ...
                              >>>>>>>Bruce A. Julseth wrote:
                              >>>>>>>>
                              >>>>>>>>"Jerr y Stuckle" <jstucklex@attg lobal.netwrote in message
                              >>>>>>>>news:Ia mdnTLNMrgA02LYn Z2dnUVZ_oLinZ2d @comcast.com...
                              >>>>>>>>>Bruc e A. Julseth wrote:
                              >>>>>>>>>>"Jeff " <jeff@quixion.n etwrote in message
                              >>>>>>>>>>news: 1174344779.7120 20.258000@p15g2 000hsd.googlegr oups.com...
                              >>>>>>>>>>>Ge t rid of the @ in front of the $db = new mysqli( ...
                              >>>>>>>>>>>>
                              >>>>>>>>>>>Th at is suppressing any errors on that line of code. Then it
                              >>>>>>>>>>>shou ld
                              >>>>>>>>>>>sh ow you in your browser what the error is and then we can help
                              >>>>>>>>>>>yo u
                              >>>>>>>>>>>furt her.
                              >>>>>>>>>>>>
                              >>>>>>>>>>>Also , you can include $Database as the 4th parameter in your
                              >>>>>>>>>>>mysq li
                              >>>>>>>>>>>cons tructor to connect to that specific database.
                              >>>>>>>>>>>>
                              >>>>>>>>>>Oka y, I now have
                              >>>>>>>>>>>
                              >>>>>>>>>> $Host = "localhost" ;
                              >>>>>>>>>> $User = "Fred";
                              >>>>>>>>>> $Database = "house";
                              >>>>>>>>>> $Password = "mypw"
                              >>>>>>>>>>>
                              >>>>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
                              >>>>>>>>>>"<b r />"
                              >>>>>>>>>> .
                              >>>>>>>>>>$Data base;
                              >>>>>>>>>>>
                              >>>>>>>>>> $db = new mysqli($Host, $User, $Password);
                              >>>>>>>>>>>
                              >>>>>>>>>> echo "Connection is " . mysqli_connect_ errno();
                              >>>>>>>>>>>
                              >>>>>>>>>>I didn't add the database to the mysqli parameter list.
                              >>>>>>>>>>>
                              >>>>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
                              >>>>>>>>>>"done "
                              >>>>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
                              >>>>>>>>>>comma nd I
                              >>>>>>>>>>execu te in my program. Do I need "Create" or "instantiat e"
                              >>>>>>>>>>somet hing
                              >>>>>>>>>>first ? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
                              >>>>>>>>>>[I'm
                              >>>>>>>>>>not sure what version. How can I find out?]
                              >>>>>>>>>>>
                              >>>>>>>>>>>
                              >>>>>>>>>>>
                              >>>>>>>>>Add this to the beginning of your script:
                              >>>>>>>>>>
                              >>>>>>>>>error_ reporting(E_ALL );
                              >>>>>>>>>ini_se t("display_erro rs", "1");
                              >>>>>>>>>>
                              >>>>>>>>>And see what error messages you get. Or check your PHP error log
                              >>>>>>>>>(whi ch
                              >>>>>>>>>may be in the Apache log).
                              >>>>>>>>>>
                              >>>>>>>>>--
                              >>>>>>>>>====== ============
                              >>>>>>>>>Remo ve the "x" from my email address
                              >>>>>>>>>Jerr y Stuckle
                              >>>>>>>>>JDS Computer Training Corp.
                              >>>>>>>>>jstucklex@attgl obal.net
                              >>>>>>>>>====== ============
                              >>>>>>>>Addin g the above code gave the error message:
                              >>>>>>>>>
                              >>>>>>>>Fatal error: Class 'mysqli' not found in
                              >>>>>>>>C:\Inet pub\wwwroot\Ser enadeHOA\php\fu nctions.php on line 47
                              >>>>>>>>>
                              >>>>>>>>This implies to me that I have a configuration problem. What should
                              >>>>>>>>I look
                              >>>>>>>>for.
                              >>>>>>>>>
                              >>>>>>>>My php.ini is in my C:\windows directory.:
                              >>>>>>>>I have extension_dir = "c:/php5/ext"
                              >>>>>>>>>
                              >>>>>>>>What else should I check?
                              >>>>>>>search for mysqli in your php.ini and comment it in.
                              >>>>>>>Make sure you have the file in a place where PHP looks.
                              >>>>>>>>
                              >>>>>>>Next thing to do is running phpinfo() and see if it finds and loads
                              >>>>>>>mysqli .
                              >>>>>>>>
                              >>>>>>>Good luck.
                              >>>>>>>>
                              >>>>>>>Regard s,
                              >>>>>>>Erwin Moller
                              >>>>>>>>
                              >>>>>>>>Thanks. .
                              >>>>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
                              >>>>>>referen ce to mysqli. I am referencing C:\Windows\php. ini and that's
                              >>>>>>the correct directory.
                              >>>>>>>
                              >>>>>>Here are the mysqli settings in my php.ini.
                              >>>>>>>
                              >>>>>>[MySQLi]
                              >>>>>>>
                              >>>>>>; Maximum number of links. -1 means no limit.
                              >>>>>>mysqli.ma x_links = -1
                              >>>>>>>
                              >>>>>>; Default port number for mysqli_connect( ). If unset,
                              >>>>>>mysqli_co nnect() will use
                              >>>>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                              >>>>>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
                              >>>>>>only look
                              >>>>>>; at MYSQL_PORT.
                              >>>>>>mysqli.de fault_port = 3306
                              >>>>>>>
                              >>>>>>; Default socket name for local MySQL connects. If empty, uses the
                              >>>>>>built-in
                              >>>>>>; MySQL defaults.
                              >>>>>>mysqli.de fault_socket =
                              >>>>>>>
                              >>>>>>; Default host for mysql_connect() (doesn't apply in safe mode).
                              >>>>>>mysqli.de fault_host =
                              >>>>>>>
                              >>>>>>; Default user for mysql_connect() (doesn't apply in safe mode).
                              >>>>>>mysqli.de fault_user =
                              >>>>>>>
                              >>>>>>; Default password for mysqli_connect( ) (doesn't apply in safe mode).
                              >>>>>>; Note that this is generally a *bad* idea to store passwords in this
                              >>>>>>file.
                              >>>>>>; *Any* user with PHP access can run 'echo
                              >>>>>>get_cfg_v ar("mysqli.defa ult_pw")
                              >>>>>>; and reveal this password! And of course, any users with read
                              >>>>>>access to this
                              >>>>>>; file will be able to reveal the password as well.
                              >>>>>>mysqli.de fault_pw =
                              >>>>>>>
                              >>>>>>; Allow or prevent reconnect
                              >>>>>>mysqli.re connect = Off
                              >>>>>Do you have ext=extension=p hp_mysqli.dll in your php.ini?
                              >>>>>>
                              >>>>>--
                              >>>>>========== ========
                              >>>>>Remove the "x" from my email address
                              >>>>>Jerry Stuckle
                              >>>>>JDS Computer Training Corp.
                              >>>>>jstucklex@attgl obal.net
                              >>>>>========== ========
                              >>>>extension=p hp_mysqli.dll is set
                              >>>>>
                              >>>>extension=p hp_mysql.dll is also set. Should I remove that?
                              >>>No, it's perfectly fine to have both of them. Are you sure you're
                              >>>editing the correct php.ini file? Where does phpinfo() say it's getting
                              >>>it from?
                              >>>>
                              >>>Does phpinfo() show you're loading the mysql extension? If neither are
                              >>>being loaded, chances are there's a problem with the location of your
                              >>>libmysqlclie nt.dll file (probably the location). But if the mysql
                              >>>extension is being loaded, then you should be able to get to the MySQL
                              >>>libs.
                              >>>>
                              >>>>
                              >>>>
                              >>>--
                              >>>============ ======
                              >>>Remove the "x" from my email address
                              >>>Jerry Stuckle
                              >>>JDS Computer Training Corp.
                              >>>jstucklex@attgl obal.net
                              >>>============ ======
                              >>php.ini is coming from C:\Windows.
                              >>>
                              >>Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
                              >>it. I have sent you a screen shot of the phpinfo.php..
                              >>>
                              >>Thanks
                              >>>
                              >>>
                              >>>
                              >OK, that means it isn't finding something it needs for mysql - probably
                              >libmysql.dll . Ensure your mysql\bin directory is in your PATH or
                              >libmysql.dll is in a directory in your PATH.
                              >>
                              >And sorry - I don't have a screen shot handy - but if it were there you'd
                              >see it.
                              >>
                              >--
                              >============== ====
                              >Remove the "x" from my email address
                              >Jerry Stuckle
                              >JDS Computer Training Corp.
                              >jstucklex@attgl obal.net
                              >============== ====
                              >
                              C:\Program Files\MySQL\MyS QL Server 5.0\bin is in my path. I went to a
                              command line and "Dir"'d this directory to make sure nothing hoaky and the
                              dir worked. libmysql.dll is in this path.
                              >
                              BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php as
                              a pdf file. Did you get it?
                              >
                              >
                              Also, another though here, Bruce. Do you have your permissions set to
                              allow your Apache user to read/execute libmysql.dll?

                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              Working...