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
?>
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: