To pull from the Database information in aiccu the table on the website?

There is a table on the website with the schedule pairs . In each of the cells 3 records: Subject, audience , teacher.
Need from the DB to get those three points on the pair. How to implement it ?
9c1c49323700480f94490d3a654ef38a.jpg
June 27th 19 at 15:05
1 answer
June 27th 19 at 15:07
Solution
Incorrect question... don't Even know where you keep the records in separate tables or in one but in different columns... But still, here's the code for working with the database output to the website, change the values below and add your alignment in table cells.

<?php 
 // define the initial data
 $db_host = 'localhost';
 $db_name = 'schedule';
 $db_username = 'root';
 $db_password = ";
 $db_table_to_show = 'table';

 // connect to database server
 $connect_to_db = mysql_connect($db_host, $db_username, $db_password);

 // connect to the database
 mysql_select_db($db_name, $connect_to_db);

 $qr_result = mysql_query("select * from" . $db_table_to_show);

 // print the page header HTML table
 echo '<style type="text/css" media="all"--> body { margin: 0; padding: 0;} ';
 echo ";
 echo ";
 echo ";
 echo ";
 echo ";
 echo ";
 echo ";

 // print HTML table data from a MySQL table 
 while($data = mysql_fetch_array($qr_result)){ 
 echo ";
 echo "; // instead of "Object", "Audience" and "Teacher" - the name of the column in the database table with your data
 echo ";
}
 echo ";
 echo '<table border="1" cellspacing="0" cellpadding="0"><thead><tr><th><b>Day of week</b></th></tr></thead><tbody><tr><td>' . $data['Subject'] . '<br>' . $data['Audience'] . '<br>' . $data['Teacher'] . '</td></tr></tbody></table>';

 // close connection to database server
mysql_close($connect_to_db);
?>
I keep in one table , but different columns for this information . But the website in one cell bring all necessary
How to do? - Kelsi.Reichert commented on June 27th 19 at 15:10
: I wrote you the code... Just for this issue - murphy_Hickle commented on June 27th 19 at 15:13
: thank you. Already figured out - Kelsi.Reichert commented on June 27th 19 at 15:16
: Another question for You!
How to make different columns in pairs was displayed? I have only Monday displayed all - Kelsi.Reichert commented on June 27th 19 at 15:19
mysql ? Seriously? This code for anything not suitable... in 2017 to write code which is already present in nature.... - Josh commented on June 27th 19 at 15:22

Find more questions by tags HTMLMySQLDatabasesPHP