Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

What am I missing?!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

What am I missing?!

Postby danfields » 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
<?php
  session_start();
?>

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

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

  <?php
    $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;
  ?>
 
</body>
</html>
danfields
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon May 13, 2013 4:25 pm

Re: What am I missing?!

Postby danfields » Fri May 24, 2013 2:34 am

I figured it our. It was just database connection parameters.
danfields
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon May 13, 2013 4:25 pm

Re: What am I missing?!

Postby johnmacd » Thu Jun 13, 2013 11:02 pm

You have given only database connection code. So how can i detect the problem.
johnmacd
New php-forum User
New php-forum User
 
Posts: 19
Joined: Wed Jun 12, 2013 9:30 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron