spyderfusion02 Posted June 26, 2008 Share Posted June 26, 2008 Hey, i was using some PEAR script for my site, but the page I load turns out blank. Is there a test script to see if PEAR is actually installed on my web host(ix web hosting). Here is the script I am using in case you are interested: <?php include('db_login.php'); require_once('DB.php'); $connection = DB::connect("mysql://$db_username:$db_password@$db_host/$db_database"); if (DB::isError($connection)){ die("Could not connect to the database: <br />".DB::errorMessage($connection)); } $query = "SELECT * FROM books NATURAL JOIN authors"; $result = $connection->query($query); if (DB::isError($result)){ die("Could not query the database:<br />$query ".DB::errorMessage($result)); } echo('<table border="1">'); echo '<tr><th>Title</th><th>Author</th><th>Pages</th></tr>'; while ($result_row = $result->fetchRow()){ echo"<tr><td>"; echo $result_row[1] . '</td><td>'; echo $result_row[4] . '</td><td>'; echo $result_row[2] . '</td></tr>'; } echo("</table>"); $connection->disconnect(); ?> Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/112045-check-if-pear-is-working-on-server/ Share on other sites More sharing options...
trq Posted June 26, 2008 Share Posted June 26, 2008 Firstly, check your include_path to see if pear is in there. <?php echo get_include_path(); ?> If it shows up in there it is likely installed, attempt to include a class. Quote Link to comment https://forums.phpfreaks.com/topic/112045-check-if-pear-is-working-on-server/#findComment-575166 Share on other sites More sharing options...
spyderfusion02 Posted June 26, 2008 Author Share Posted June 26, 2008 Firstly, check your include_path to see if pear is in there. <?php echo get_include_path(); ?> If it shows up in there it is likely installed, attempt to include a class. This is what is displayed: .;c:\PHP\pear Does this mean it is installed? Quote Link to comment https://forums.phpfreaks.com/topic/112045-check-if-pear-is-working-on-server/#findComment-575188 Share on other sites More sharing options...
.josh Posted June 26, 2008 Share Posted June 26, 2008 hmm you say your page is blank but you have stuff like echo('<table border="1">'); echo '<tr><th>Title</th><th>Author</th><th>Pages</th></tr>'; that aren't in any conditions or anything, so you should at least be seeing that. Do you have error reporting turned on? Stupid question, but your filename is *.php not like *.html right? Quote Link to comment https://forums.phpfreaks.com/topic/112045-check-if-pear-is-working-on-server/#findComment-575196 Share on other sites More sharing options...
spyderfusion02 Posted June 26, 2008 Author Share Posted June 26, 2008 yes, the filename is .php Quote Link to comment https://forums.phpfreaks.com/topic/112045-check-if-pear-is-working-on-server/#findComment-575212 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.