Query failed suddenly without making any changes in the script

Discussion in 'PHP' started by hope2life, Aug 23, 2011.

  1. #1
    Hi,
    I used to upload content in mysql using a php script. The script was working fine and content was getting uploaded in mysql. But now suddenly it says "query failed" and the script dont work to upload content in mysql. I never made any changes to the script. Want to know why this happening suddenly?
    Any help would be greatly appreciated. Is it that mysql has not enough space left? Till now I only used around 2.42 MB space for mysql as what it says in control panel. Hosting package is however 5GB which is what it says in control panel.

    Thanks!
     
    hope2life, Aug 23, 2011 IP
  2. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #2
    try adding an or clause to your mysql query.

    E.g. mysql_query("something")or trigger_error(mysql_error());
     
    ssmm987, Aug 23, 2011 IP
  3. against

    against Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Check the server logs - there should be some info of why it's happening.
    You may need to enable error logging in cPanel.
     
    against, Aug 23, 2011 IP
  4. hope2life

    hope2life Active Member

    Messages:
    1,641
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    90
    #4
    sorry nothing helping
     
    hope2life, Aug 24, 2011 IP
  5. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #5
    Did your text include a '.

    If your query failed MYSQL always returns a response with MYSQL_ERROR() if you have no response you didn't send a query to the database!
     
    EricBruggema, Aug 24, 2011 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    Add Firebug and FirePHP to your toolkit. Have Firebug send you the query just before the mysql_query line, then you can see the actual query being sent. If that doesn't help you, you can put that query into phpMyAdmin (I wouldn't be on a site that doesn't have it) and see why it's not working.
     
    Rukbat, Aug 24, 2011 IP