What am I missing?!

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Thu May 23, 2013 6:02 pm

I am trying to list data from a db table, but cannot get anything to work. I created two pages to list and add data to the table in question. That works perfectly. I copied some code from the page that lists the data in an HTML table, but now it does not work on the new page. All I get is the header graphic and an empty page.

I do not believe the inner most PHP code is being executed. What am I doing wrong?

Code: Select all


  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>BitK Events</title>

<body >
  <img src="admin/AdminBanner.jpg"><br>

    $host           =       'localhost'; 
    $user           =       'cmillie_bitkdba';
    $pass           =       'apassword';
    $database       =       'cmillie_backend';
    $connection = mysql_connect ($host, $user, $pass) or die                      ('Error connecting to mysql'.mysql_error());
    mysql_selectdb($database) or die ('Error selecting database'.mysql_error());
    $query = "SELECT * FROM events";
    echo $query;


Fri May 24, 2013 2:34 am

I figured it our. It was just database connection parameters.

New php-forum User
New php-forum User
Posts: 72
Joined: Wed Jun 12, 2013 9:30 pm

Thu Jun 13, 2013 11:02 pm

You have given only database connection code. So how can i detect the problem.

Post Reply