Hey all, new to this site but i'm trying to call multiple values from multiple mysql databnases to show up in one table, but its throwing up an error at line 55, or
while($row = mysql_fetch_array($result));
so i was wondering if I'm causing havoc with this statement here, im new to php, and i'm not really enjoying the experience at the moment!
Any help at all would be amazing... thanks!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $pagetitle; ?></title>
<meta http-equiv="Content-Type"
Content="text/html; charset=utf-8" />
<link rel=stylesheet type="text/css" href="styles1.css">
</head>
<body>
<div id="header">
<div id="branding">
<h1><img src= "logo.gif" width="250" height="100" alt=logo" /></h1>
</div> <!—end of branding div -->
</div> <!--end of header div -->
<div id="navigation">
<ul>
<li><a href= "staff.php">Exit</a></li>
</ul>
</div> <! -- end of navigation div -- >
<div id="bodycontent">
<?php
mysql_connect("x.x.x.x", "xxx", "xxx")
or die (mysql_error("Could not connect to database, please try login again"));
$db = mysql_select_db("team7testdb") or die (mysql_error("Connection Error"));
$query = "(SELECT * FROM businesscustomer) union all(SELECT * FROM businesscontact) union all(SELECT * FROM telephone) union all(SELECT * FROM email)";
$result = mysql_query($query);
echo "<table border='2'>
<tr>
<th>Business Name</th>
<th>Vat Number</th>
<th>Company Type</th>
<th>Customer ID</th>
<th>Contact Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Job Title</th>
<th>Department</th>
<th>Home Number</th>
<th>Work Number</th>
<th>Mobile Number</th>
<th>Personal Email</th>
<th>Work Email</th>
</tr>";
while($row = mysql_fetch_array($result));
{
echo "<tr>";
echo "<td>" . $row['businessName'] . "</td>";
echo "<td>" . $row['vatNo'] . "</td>";
echo "<td>" . $row['companyType'] . "</td>";
echo "<td>" . $row['customerID'] . "</td>";
echo "<td>" . $row['contactNo'] . "</td>";
echo "<td>" . $row['fName'] . "</td>";
echo "<td>" . $row['lName'] . "</td>";
echo "<td>" . $row['department'] . "</td>";
echo "<td>" . $row['jobTitle'] . "</td>";
echo "<td>" . $row['number'] . "</td>";
echo "<td>" . $row['number2'] . "</td>";
echo "<td>" . $row['number3'] . "</td>";
echo "<td>" . $row['emailAdd'] . "</td>";
echo "<td>" . $row['emailAdd2'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>