63 088
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #25738 in C++ for Bronue-

Question #25738
Suppose I have a database called HumanResources to which I can connect on server localhost with username “peanut” and password “butter”. Suppose Human Resources has a table called Employee. Write a php page that will connect to this database and print all the rows found in the Employee table to a web page.
Expert's answer
<?php
mysql_connect(localhost, "peanut", "butter");
mysql_select_db("HumanResources");

$data = mysql_query("SELECT * FROM Employee");
mysql_close();

$colCount = mysql_num_fields($data);

echo "<table>\n";
echo "\t<tr>\n";
echo "\t\t<td colspan='$colCount'>Employee table</td>\n";
echo "\t</tr>\n";

while ($row = mysql_fetch_row($data))
{
echo "\t<tr>\n";
foreach ($row as $cell)
echo "\t\t<td>$cell</td>\n";
echo "\t</tr>\n";
}
echo "</table>"
?>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions