mysql error and php header
-
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
-
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
-
How do you log the error? You will only be able to log it directly to a file, not to the screen.
yes, I'm logging it into a file using error_log() function. Faris Madi