PHP ffiles not showing on the page

cjax

New member
Joined
Mar 13, 2010
Messages
2
PHP files not showing. I'm just getting a black page

Hi All my first post.

I'm a college student and have a project that needs a database to run..


I have all my files working OK and correctly using XAMPP on a windows XP sp3 machine.
I exported the SQL to a file from the XAMPP machine and Imported the SQL file to the new DB on the server..
I have uploaded all the .php files to the server and made a new database and entered the host, username, password and database name into the include('db_connection.php'); file like so...

<?php
//the connection to the database. The db_connection.php file

//database connection
$dbc = @mysqli_connect('localhost','MyName_root','password','MyName_dbName')
OR die('Error opening your Database <br />'.mysqli_connect_error());

?>


BUT none of the SELECT statements seem to work.
All I get is a blank page!! Except for the image links, they show at the top of the age but none of the select statement.
I do not get any error messages.

Any ideas??

One php file reads...

<?php

echo "<a href = addNewEvent.php><img src = 'images/addNewEvent.gif' border='0' /></a>  
<a href = editEvents.php><img src = 'images/administration.gif' border='0' /></a>";
echo "<br /><a href = #><img src = 'images/reportPost.gif' border='0' /></a>";


//connection to the database used for the text editor
include('db_connection.php'); //this has all the usernames etc...

//the SQL query to perform
$query = "SELECT *
FROM monthly_events
WHERE active = 1
ORDER BY id DESC;";

$results = mysqli_query($dbc,$query); // a variable to hold the result of the SQL query

while($row = mysqli_fetch_array($results)) {

$allEvents = $row["event"]; // event is the field name in the monthly_events table

echo $allEvents;}

mysqli_close($dbc); //close DB connection

?>
 
Last edited:
You're probably on the wrong forum.

This forum is a self-support forum for hosting companies and others using the DirectAdmin Control Panel to manage a Linux or FreeBSD powered webserver.

If you're buying webhosting from a hosting company, and the project isn't working on your webhosting account, then you might want to contact your hosting company, as no one here will have any idea how they've set up your server.

If you're using a DirectAdmin powered system and you are the server administrator, then the first thing to do is make sure that PHP is turned on for your account.

Then you should check the apache error logs on your server.

Otherwise you're in the wrong place, but might get help from a PHP-centric forum.

Jeff
 
Sorted now thanks.

The version of XAMPP I was using was running PHP version 5.x.x.x
and my hosting package was running PHP version 4.x.x.x.

So had to upgrade my hosting package.

c jax
 
Back
Top