Skip to main content
deleted 49 characters in body; edited tags
Source Link

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";

I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";
no need to say thankes for answer on the top of post
Source Link
Mayank K. Swami
  • 57.3k
  • 23
  • 130
  • 148

Edit: I'm going to change to mysql_fetch_array so thank you all for that input.

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";

Edit: I'm going to change to mysql_fetch_array so thank you all for that input.

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";
removed error hiding @
Source Link
Pachi
  • 25
  • 6

Edit: I'm going to change to mysql_fetch_array so thank you all for that input.

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
@mysql_select_dbmysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";

Edit: I'm going to change to mysql_fetch_array so thank you all for that input.

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
@mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";

Edit: I'm going to change to mysql_fetch_array so thank you all for that input.

Okay so as the title says, I'm having a hard time figuring out how to get my table to display as a web page.

Everything else is working fine. I've been able to use a form to write records TO the table, but I'm simply unable to display the table.

Thanks in advance!

Here's my code:

$host = "***";
$userName = "***";
$passWord = "***";
$db = "doctorWho";

mysql_connect($host,$userName,$passWord);
mysql_select_db($db) or die( "Unable to access database");
$query = "SELECT * FROM patients";

$result = mysql_query($query);

echo "<table border='1'>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Address</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Marital Status</th>
    <th>Medication</th>
    <th>Date Rx'd</th>
    <th>Quantity</th>
    </tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['lastName'] . "</td>";
  echo "<td>" . $row['firstName'] . "</td>";
  echo "<td>" . $row['address'] . "</td>";
  echo "<td>" . $row['age'] . "</td>";
  echo "<td>" . $row['sex'] . "</td>";
  echo "<td>" . $row['maritalStatus'] . "</td>";
  echo "<td>" . $row['medication'] . "</td>";
  echo "<td>" . $row['medsWhen'] . "</td>";
  echo "<td>" . $row['medsQuant'] . "</td>";
  echo "</tr>";
 
  }
echo "</table>";
added 89 characters in body
Source Link
Pachi
  • 25
  • 6
Loading
Source Link
Pachi
  • 25
  • 6
Loading