Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the solution total html with php and database connections</p> <pre><code> &lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;database connections&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php $username = "database-username"; $password = "database-password"; $host = "localhost"; $connector = mysql_connect($host,$username,$password) or die("Unable to connect"); echo "Connections are made successfully::"; $selected = mysql_select_db("test_db", $connector) or die("Unable to connect"); //execute the SQL query and return records $result = mysql_query("SELECT * FROM table_one "); ?&gt; &lt;table border="2" style= "background-color: #84ed86; color: #761a9b; margin: 0 auto;" &gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Employee_id&lt;/th&gt; &lt;th&gt;Employee_Name&lt;/th&gt; &lt;th&gt;Employee_dob&lt;/th&gt; &lt;th&gt;Employee_Adress&lt;/th&gt; &lt;th&gt;Employee_dept&lt;/th&gt; &lt;td&gt;Employee_salary&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php while( $row = mysql_fetch_assoc( $result ) ){ echo "&lt;tr&gt; &lt;td&gt;{$row\['employee_id'\]}&lt;/td&gt; &lt;td&gt;{$row\['employee_name'\]}&lt;/td&gt; &lt;td&gt;{$row\['employee_dob'\]}&lt;/td&gt; &lt;td&gt;{$row\['employee_addr'\]}&lt;/td&gt; &lt;td&gt;{$row\['employee_dept'\]}&lt;/td&gt; &lt;td&gt;{$row\['employee_sal'\]}&lt;/td&gt; &lt;/tr&gt;\n"; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;?php mysql_close($connector); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Source: <a href="https://stackoverflow.com/questions/4331353/retrieve-data-from-db-and-display-it-in-table-in-php-see-this-code-whats-wron">retrieve data from db and display it in table in php .. see this code whats wrong with it?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload