Search This Blog

die() and exit() Functions in php

<?php

@mysql_connect('localhost','root','') or die("not connect");


echo 'connected';

?>

outout  : connected
 
<?php


@mysql_connect('localhost','root','n') or die("not connect");

echo 'connected';

?>

outout  : not connect

<?php

//   " @ " use for errors from php not display

@mysql_connect('localhost','root','') or exit("not connect");

echo 'connected';

?>

outout  : connected

<?php


@mysql_connect('localhost','root','n') or exit("not connect");

echo 'connected';

?>

outout  : not connect

note : 1)     can use " || " in the place of " or " 
         2)    " @ " use for errors not display from php

Share Links

Related Posts Plugin for WordPress, Blogger...