Program

Submitted by: Submitted by

Views: 489

Words: 341

Pages: 2

Category: Science and Technology

Date Submitted: 09/29/2013 05:35 PM

Report This Essay

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>Core of the College List .php file</title>

<meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" />

<meta name="created" content="Tue, 06 Sep 2011 08:56:03 GMT" />

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<meta name="description" content="" />

<meta name="keywords" content="" />

</head>

<body>

<?php

$DBConnect = mysql_connect('localhost','root','');

if (!$DBConnect) {

die(mysql_error());

}

if (!mysql_select_db('university', $DBConnect)) {

die(mysql_error());

}

else {

$SQLQuery = "select * from college";

$result = mysql_query($SQLQuery, $DBConnect);

$numrows = mysql_num_rows($result);

if ($numrows > 0) {

?>

<p align="center"><font size="+1">LIST OF COLLEGES</font></p>

<table border="1" cellpadding="5" align="center">

<tr>

<td><strong>No.</strong></td>

<td><strong>Acronym</strong></td>

<td><strong>Name</strong></td>

<td><strong>Location</strong></td>

<td><strong>Dean</strong></td>

</tr>

<?php

while ($row = mysql_fetch_assoc($result)) {

print "<tr>";

foreach ($row as $field_name => $field_value) {

print "<td>$field_value</td>";

}

print "</tr>";

}

} //end of if ($numrows > 0)

else { //if $numrows == 0

echo '<font size="+2" color="red">SORRY, there are no College records to display.</font>';

}

}...