I've tried all day to get this stupid page to work, and I can't figure it out. I'm trying to get info from a table to show up in a table in a php file.

```
if (!mysql_connect($servername, $username, $password))
  die("Connection failed: ");

if (!mysql_select_db($dbname))
  die("Can't select database");

$result = mysql_query("SELECT problem_id, machine_id, description FROM tbl_problem");

if (!$result)
{
  die("Query to show fields from table failed");
}

$fields_num = mysql_num_fields($result);
echo "<table class='table table-hover'><tr><th>Problem ID</th><th>Machine Number</th><th>Problem Description</th><th>     </th></tr>";

while($row = mysql_fetch_row($result))
{
  echo "<tr><td>" . $row['problem_id']. "</td><td>" . $row['machine_id']. "</td><td>" . $row['description']. "</td><td><button type='button' class='btn btn-danger'>Resolved?</button></td></tr>";
}
echo "</table>";

```

I've used several websites to try and get this to work, but nothing seems to be working. If syntax is really out of whack, it's because I'm modelling it after everything I've seen similar to what I'm trying to do.

What it should do, is if the table "tbl\_problem" has data in it, display a table on the website that shows the Problem ID, Machine ID, and Description as well as a button to the right of that which allows you to delete the row from "tbl\_problem" (the button is there as a placeholder right now, I don't have code for it to actually delete yet, but if someone wanted to point me in the right direction with that, I'd be much obliged!). 

When I run it, I get no table, and instead see the following: 

> 
> Problem IDMachine NumberProblem Description "; while($row = mysql\_fetch\_row($result)) { echo "" . $row['problem\_id']. "" . $row['machine\_id']. "" . $row['description']. ""; } echo "[The Resolved? button displays properly here]"; /*else { echo "There are no problems! :)"; }*/ ?>
> 
> 
>