Created
March 26, 2012 21:32
-
-
Save b-adams/2209895 to your computer and use it in GitHub Desktop.
Turning on PHP display_errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
$db_handle = pg_connect("dbname=CS325_astudent user=astudent password=apassword"); | |
$query = "SELECT * FROM schemaname.tablename"; | |
$result = pg_exec($db_handle, $query); | |
echo "Number of rows: " . pg_numrows($result); | |
pg_freeresult($result); | |
pg_close($db_handle); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "<html>Turning on and off display_errors:<dl><dt>A Test: "; | |
echo ini_get('display_errors'); | |
echo "</dt><dd>"; | |
foreach(1 as $i); | |
if(!ini_get('display_errors')) { | |
ini_set('display_errors',1); | |
} | |
echo "</dd><dt>B Test: "; | |
echo ini_get('display_errors'); | |
echo "</dt><dd>"; | |
foreach(1 as $i); | |
if(ini_get('display_errors')) { | |
ini_set('display_errors',0); | |
} | |
echo "</dd><dt>C Test: "; | |
echo ini_get('display_errors'); | |
echo "</dt><dd>"; | |
foreach(1 as $i); | |
echo "</dd></dl>"; | |
echo "<ul><li><a href=\"http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors\">display-errors</a></li><li><a href=\"http://www.php.net/manual/en/function.ini-set.php\">ini_set()</a></li></ul>"; | |
echo "<script src=\"https://gist.github.com/2209895.js?file=err.php\"></script></html>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment