All pastes #255727 Raw Edit

Anonymous

public text v1 · immutable
#255727 ·published 2006-11-23 08:41 UTC
rendered paste body
function Search()
{
	echo "<strong>Search</strong>";
	?>
	<form name="Search" id="Search" action="" method="post" />
	Article NO: <input name="ArticleNO" type="text" id="ArticleNO" /><br>
	Description: <input name="Description" type="text" id="Description" /><br />
	<input name="Search" type="button" value="Search" id="Search" />
	</form>
	<?php 
	echo "<table class=\"articletable\"><tr bgcolor=\"\#0000FF\"><td><H3>Article NO</td><td><H3>Yards</td><td><H3>Description</td></tr>";
	if(isset($_POST['ArticleNO']) or isset($_POST['Description']))
	{
		include 'config.php';
		include 'opendb.php';
		$query = 	"SELECT ArticleID, TotalYards, Description 
					FROM Articles WHERE ArticleID LIKE '%".$_POST['ArticleNO']."%' 
					AND Description LIKE '%".$_POST['Description']."%'";
		$result = mysql_query($query) or die('MySQL Query Error');
		while($row = mysql_fetch_assoc($result))
		{
		echo "<tr><td>{$row['ArticleID']}</td><td>{$row['TotalYards']}</td><td>{$row['Description']}</td></tr>";
		}
		echo "</table>";
		include 'closedb.php';
	}
	else
	{
		echo "</table>";
	}
}