mysql_connect() losing connections from cmd line

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Michaels

    mysql_connect() losing connections from cmd line

    I am running windows XP and PHP 5.1.2 with the MySQL extension enabled in
    php.ini.
    I am using mysql_connect() without any fancy options to connect to MySQL and
    do some stuff without using mysql_close() at the end, and debugging several
    files in sequence.



    I eventually run into
    C:\prj\quiz\wit husers>php taaddtt2grp.php
    PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link
    resourc
    e in C:\prj\quiz\wit husers\header.p hp on line 28
    PHP Warning: mysql_fetch_ass oc(): supplied argument is not a valid MySQL
    result
    resource in C:\prj\quiz\wit husers\header.p hp on line 29
    PHP Warning: mysql_free_resu lt(): supplied argument is not a valid MySQL
    result
    resource in C:\prj\quiz\wit husers\header.p hp on line 30


    in all sorts of programs. Once I get this, I am not able to run a PHP that
    uses those include files again. I suspect there's some sort of cacheing
    going on here. this is driving me up the wall. One time, it took my
    database down during a simple DROP TABLE operation. The database service
    couldn't reconnect when I restarted it. shutting down & restarting the
    database doesn't help.

    any suggestions on how to proceed?


  • Jim Michaels

    #2
    Re: mysql_connect() losing connections from cmd line

    found the source of the problem in my header file.
    Gotta stop posting like this.
    Still, I think it's odd that PHP was able to take out the MySQL server once.

    "Jim Michaels" <NOSPAMFORjmich ae3@yahoo.com> wrote in message
    news:TsydnevuAr Ns3rvZnZ2dnUVZ_ v6dnZ2d@comcast .com...[color=blue]
    >I am running windows XP and PHP 5.1.2 with the MySQL extension enabled in
    >php.ini.
    > I am using mysql_connect() without any fancy options to connect to MySQL
    > and do some stuff without using mysql_close() at the end, and debugging
    > several files in sequence.
    >
    >
    >
    > I eventually run into
    > C:\prj\quiz\wit husers>php taaddtt2grp.php
    > PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link
    > resourc
    > e in C:\prj\quiz\wit husers\header.p hp on line 28
    > PHP Warning: mysql_fetch_ass oc(): supplied argument is not a valid MySQL
    > result
    > resource in C:\prj\quiz\wit husers\header.p hp on line 29
    > PHP Warning: mysql_free_resu lt(): supplied argument is not a valid MySQL
    > result
    > resource in C:\prj\quiz\wit husers\header.p hp on line 30
    >
    >
    > in all sorts of programs. Once I get this, I am not able to run a PHP
    > that uses those include files again. I suspect there's some sort of
    > cacheing going on here. this is driving me up the wall. One time, it
    > took my database down during a simple DROP TABLE operation. The database
    > service couldn't reconnect when I restarted it. shutting down &
    > restarting the database doesn't help.
    >
    > any suggestions on how to proceed?
    >
    >[/color]


    Comment

    • Raqueeb Hassan

      #3
      Re: mysql_connect() losing connections from cmd line

      > found the source of the problem in my header file.

      Thanks for posting back with the troubled area. It's a good sign. You
      might point out the details for others.

      Thanks.


      --
      Raqueeb Hassan
      Bangladesh

      Comment

      • Jim Michaels

        #4
        Re: mysql_connect() losing connections from cmd line


        "Raqueeb Hassan" <wideangle@gmai l.com> wrote in message
        news:1143384424 .815745.146680@ t31g2000cwb.goo glegroups.com.. .[color=blue][color=green]
        >> found the source of the problem in my header file.[/color]
        >
        > Thanks for posting back with the troubled area. It's a good sign. You
        > might point out the details for others.
        >
        > Thanks.
        >
        >
        > --
        > Raqueeb Hassan
        > Bangladesh
        >[/color]

        Not much to tell. Just one of those mindless errors. Can't believe I did
        it.
        For one thing, I was including dbinc.php after using the functions. it's a
        wonder it actually worked sometimes (bug in PHP?). I also had to move the
        functions up before I used them.


        Comment

        Working...