76 415
Assignments Done
Successfully Done
In May 2019

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
mysql_connect(localhost, "peanut", "butter");

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

$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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions