Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

php

$
0
0
<!DOCTYPE html>


<html lang = "en">

<head>
		<title> Facilities</title>
		<meta charset = "utf-8"/>
		<link type="text/css" rel="stylesheet" href="fac.css"/>
		<script type="text/javascript" src="fac.js"> </script>
</head>

<body>

<?php
if(isset($_POST['facNum']))
	{
		$DBConnect = @mysql_connect("localhost", "fac90", "fac90");
		if (!$DBConnect)
		echo "<p>The database server is not available</p>";
		else
		echo "<p>success</p>";
		$DBName ="fac90";
		if (@mysql_select_db($DBName))
		echo "<p></p>";
		else
		echo "<p>The database is not available.</p>";

		$facNum = $_POST['facNum'];
		$sqlquery = "SELECT * FROM teams WHERE facNum = '$facNum';";
		$result = @mysql_query($sqlquery) or die ('<p> Error </p>');
		$num_rows = mysql_num_rows($result);
		echo $num_rows;

		echo "<table width='100%' border='1'>";
		echo "<tr><th>Room Num</th> <th> Name</th> <th>Department</th>
			<th>Materials</th> <th>Shipments</th> <th>Receivals</th>
			<th>Packing</th> <th>Location</th> <th>Reference</th>
			<th>Quantity</th> <th>Supplied by</th> <th>Phone</th>
			<th>Next Shipment</th> <th>Dates</th>
			</tr>";



		$Row = mysql_fetch_assoc($result);
		do {
		echo "<tr><td>{$Row['facNum']}</td><td>{$Row['Name']}</td>
				<td>{$Row['department']}</td><td>{$Row['materials']}</td>
				<td>{$Row['shipments']}</td><td>{$Row['rec']}</td>
				<td>{$Row['packing']}</td><td>{$Row['loca']}</td>
				<td>{$Row['Reference']}</td><td>{$Row['quant']}</td>
				<td>{$Row['supplied']}</td><td>{$Row['phone']}</td>
				<td>{$Row['NextShipment]}</td><td>{$Row['dates']}</td>
				</tr>";
		
		$Row = mysql_fetch_assoc($result);
		} while ($Row);
		echo "</table>"; mysql_close($DBConnect);}

?>

</body>
</html>

Hi guys, I have a php file that is not working because I get this error "Parse error: syntax error, unexpected $end" It's saying the last line, but I put a closing bracket after "?>" and then it does not display my database at all only a blank screen. I also have a separate ..html file that has a form with the button to click for the user enters the facilityid. After the user enters the facilityID and clicks on the submit button it should display the database based on the id number, and it currently gives me the above error. Any help would be appreciated. Thanks.


Viewing all articles
Browse latest Browse all 13200

Trending Articles