I need someone to look at a php error

Discussion in 'PHP' started by pixeladd, Jun 17, 2008.

  1. #1
    Im sure its pretty basic

    i have an error on a script ive installed

    Fatal error: Cannot redeclare date_format() in /home/thedp/public_html/lib/lib_common.php on line 279

    can anyone help
     
    pixeladd, Jun 17, 2008 IP
  2. aqlx86

    aqlx86 Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i think you have included the php script twice

    please read about
    include_once() or require_once()
     
    aqlx86, Jun 17, 2008 IP
  3. pixeladd

    pixeladd Banned

    Messages:
    2,238
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #3
    im guessing that was just a post count answer

    anyone able to help?

    ive got a few $ in my paypal

    if anyone can help il send it them
     
    pixeladd, Jun 17, 2008 IP
  4. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    that was not a post count answer,, you should actually read up about those. also, if you could include your php code, you may get more help.

    he was correct in saying that you may be including files twice, because what your error is saying is that something has been said, and then something is trying to either say it again, or is trying to change it. There are certain things in php that do not allow a redclaration or change, so they return an error. This seems to be one of them.
     
    X.Homer.X, Jun 17, 2008 IP
  5. aqlx86

    aqlx86 Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    its too simple.. date_format() is a php date/time function and you created a function with that name also..

    another post... hahaha
     
    aqlx86, Jun 17, 2008 IP
  6. pixeladd

    pixeladd Banned

    Messages:
    2,238
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #6
    apologies, i knw nothing about php and it just seemed like a generic answer

    ok so any suggestions to what i should do

    thanx for your help!!

    2 types of people i love
    coders and graphics people
     
    pixeladd, Jun 17, 2008 IP
  7. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    First off, post your PHP code so we can see exactly whats calling the error. Unless aqlx86 knows the error right off the bat. :p
     
    X.Homer.X, Jun 17, 2008 IP
  8. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #8
    What script is this? Maybe I can install it for you.
     
    Dondon2d, Jun 17, 2008 IP
  9. aqlx86

    aqlx86 Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    basically you just need to rename that function if thats the problem.. like dateFormat or DateFormat
     
    aqlx86, Jun 17, 2008 IP
    pixeladd likes this.
  10. pixeladd

    pixeladd Banned

    Messages:
    2,238
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #10
    found the solution

    i had to do a global search and replace

    @aqlx86
    thanx alot mate
    rep
     
    pixeladd, Jun 17, 2008 IP