Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
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" />
$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";
I figured it our. It was just database connection parameters.
- New php-forum User
- Posts: 75
- Joined: Wed Jun 12, 2013 9:30 pm
You have given only database connection code. So how can i detect the problem.
Who is online
Users browsing this forum: No registered users and 3 guests