Forum Moderators: coopster
I have created a database where there is cross references from a supplier to another make all the information is there but cant get it to display on the screen?
Any help would be greatly appreciated....
code is as follows:
<body>
<?
include("connect.php");
?>
<form action="<?php echo $_SERVER['php_self'];?>" method="POST">
<label>enter oem number:<br />
<input name="search1" type="text" size="15"></input></label><br />
<input type="submit" value=" enter cross ref " />
</form>
<?
if (isset($_REQUEST['search1'])) {
$search = $_REQUEST['search1'];
$sql="select bowers from xref where oem ='$search'";
if (@mysql_query($sql)) {
echo '<p>' . $sql['bowers'].'</p>';
}else{
echo'<p>error retrieving cross reference: ' . mysql_error() . '</p>';
}
}
?>
</body>
cheers - Mark
[edited by: calbo at 2:46 pm (utc) on Oct. 12, 2005]
U R A STAR!
thanks for pointing me in the right direction.......I've been scratching my head on this for 2 days!
I have now Changed it to:
<?
if (isset($_REQUEST['search1'])) {
$search = $_REQUEST['search1'];
$result = mysql_query("select bowers from xref where oem ='$search'");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("bowers: %s" , $row[0], $row[1]);
}
}else{
echo'<p>error adding cross reference: ' . mysql_error() . '</p>';
}
?>
I am forever in your debt.
Thanks again - Mark