I started using Xampp a little time ago, yesterday a new problem occured.
When I run a php-file, he shows nothing, or a part of the code.
So i ran this code:
- Code: Select all
<?
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once('classes/Database.php');
$db = new Database('database/pages.db');
$db->query("SELECT * FROM Pages");
if($db->numRows() == 0) {
echo"No articles";
} else {
foreach($db->rows() as $article) {
echo $article['title'],'<br>';
}
echo '<p>', $db->numRows(), ' articles</p>';
}
$db->disconnect();
?>
My browser showed me:
query("SELECT * FROM Pages"); if($db->numRows() == 0) { echo"No articles"; } else { foreach($db->rows() as $article) { echo $article['title'],'
'; } echo '
', $db->numRows(), ' articles
'; } $db->disconnect(); ?>
Strange, because when I run this script on a webhost, everything works!
Also I tried a simple test like:
- Code: Select all
<? echo 'Hello world'; ?>
Screen was empty.
I have searched on the internet for similiar problems, but it didn't help me out.
I am sure i am running the control-panel of xampp with apache and mysql.
Who can help me out?
Another thing: I have tried to use wampserver, to check it's my fault or xampp. wampserver gives me the same problem!
So guys, who can help me out?
Thank you all!
Bob