Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. mysql error and php header

mysql error and php header

Scheduled Pinned Locked Moved Web Development
helpphpdatabasemysqlcom
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    militiaware
    wrote on last edited by
    #1

    I got this weird problem 1....mysql_query("run a query"); 2....check if mysql_query fail 3....yes fail 4....log the mysql_error 5....redirect using "Header('Location: http://mydomain.com');" 6....else (query success) 7....redirect using "Header('Location: http://yourdomain.com');" the problem is in line 5, php will not redirect because there's line number 4. If we removed line 4, the page will redirect correctly. in this case there's no error on the log files. can someone help me out? thanx :confused: Faris Madi

    J 1 Reply Last reply
    0
    • M militiaware

      I got this weird problem 1....mysql_query("run a query"); 2....check if mysql_query fail 3....yes fail 4....log the mysql_error 5....redirect using "Header('Location: http://mydomain.com');" 6....else (query success) 7....redirect using "Header('Location: http://yourdomain.com');" the problem is in line 5, php will not redirect because there's line number 4. If we removed line 4, the page will redirect correctly. in this case there's no error on the log files. can someone help me out? thanx :confused: Faris Madi

      J Offline
      J Offline
      Johnny
      wrote on last edited by
      #2

      How do you log the error? You will only be able to log it directly to a file, not to the screen.

      M 1 Reply Last reply
      0
      • J Johnny

        How do you log the error? You will only be able to log it directly to a file, not to the screen.

        M Offline
        M Offline
        militiaware
        wrote on last edited by
        #3

        yes, I'm logging it into a file using error_log() function. Faris Madi

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups