SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2001
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Queries run at telnet connection but not in the scripts - please help

    I have been using php and mysql on a linux apache server with.

    Recently I moved my files to an other server and noticed that some queries returned a not valid result (no result identifier).

    If I run these queries from a telnet connection with the database they returned the correct records.

    Does anyone know what is happening?

    Thanks in advance,
    Christine

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your connection string might be causing this. Can you show us the portion of code that is breaking and can you show us the connection portion of your code.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Member
    Join Date
    Jul 2001
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    More on the problem

    A bit of the code...

    mysql_connect("127.0.0.1","root","mypassword");

    $result = mysql_db_query("filaki", "SELECT cards.cardID, cards.path, cards.title, cards.unique FROM cards,relcategories WHERE cards.cardID=relcategories.cardID ");

    Generally the script queries work well: I can connect, I get results etc.

    I have this problem only with some queries that use 2-3 specific tables...I can run them succesfully at telnet but not in the script. The connection string is the same in both cases.

    Could it have anything to do with the table type ( MyISAM etc)? I first dumped the base at the first server and then reinstalled it at the second server. Later I modified some tables... Does that help?

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might try this to get a better idea of what is breaking

    PHP Code:
    $db mysql_connect("localhost","root","mypassword"); 

    $result mysql_query("SELECT cards.cardID, cards.path, cards.title, cards.unique FROM cards,relcategories WHERE cards.cardID=relcategories.cardID ") or DIE(mysql_error()); 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Member
    Join Date
    Jul 2001
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get a "Got error 134 from table handler" response.

    Thanks for the tip, now I have somewhere to start from...

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like a table got corrupted, that would explain why it only happens on some queries. You can run some checks on your MyISAM tables using myisamchk form the telnet prompt. More here...
    http://mysql.he.net/documentation/my...le_maintenance
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •