Jump to content

[SOLVED] PHP error display..and mysql connection


Recommended Posts

Hello there

 

I am trying to figure out why PHP is not showing any error in the browser window even though i set it to error_reporting(ALL) and display_error=on. Is there any other configuration setting do i need to look into php.in. Your help is appreciated. I have got one more question which is  really strange error. While connecting to mysql server. Mysql client connects to sever with my username and password, but when i connect to server with same username and password through phpmyadmin it gives me an error saying access violation so i had to make my default setting for mysql i.e. no password. This works fine with both mysql client and PHPmyadmin. Now there are two questions raised.

 

your help will be appreciated..

Thanks for the reply...

 

I did check the error log..it shows for following script.

 

the script is

 

<?php

err_log();

echo "Really Bad ....";

Log Error:[20-Jan-2008 11:21:18] PHP Fatal error:  Call to undefined function err_log() in C:\apache\Apache2\htdocs\new.php on line 3

 

This is perfectly ok..but when i remove err_log() function and script is..

 

<?php

 

echo "Really Bad";

 

The out put on browser is Really Bad but the error log is empty even though there is no closing tag.

how to show error 's on browser window.

First of all ..i take my apologies that some of you didn't understand my questin..may be because of my bad english...

 

Now let me explain it..I am totally aware about PHP  will be end up its  execution till last statement. but

 

i will show you example that horifies me..

 

<?php

 

echo "Really Bad". PHP_EOL ;

 

?>

 

Kill

 

Kill is also part of php file called Test.php

 

The output i get Really Bad Kill . Please make me clear about the idea..Does PHP carries its execution beyond the tags..

A PHP document/script/file is by default a HTML document first. That's why we have to use opening and closing PHP tags.

 

Anything outside PHP tags is just plain HTML. So, "Kill" is displayed because the browser treats it as HTML (and not PHP displaying that).

 

hth.

 

Thank you very much....I forgot this in meanwhile..you are right its html..

but

 

what to do with this ...

 

<?php

 

$db= mysql_connect("localhost","user","pass");

 

if(!$db)

{

die ("not connected");

}

else

echo "Connected";

 

I don't have closing tag but it shows me connected....

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.