Code: Select all
<?
include("dbinfo.inc.php");
// grabbing variables from the url, but they can come from anywhere you want
$t2 = $_GET["id"];
$t1 = $_GET["file_id"];
$sql= mysql_query("select * from table1 where file_id = '$term2'");
$sql2 = mysql_query("select * from table2 where file_id = '$term2'");
$sql3 = mysql_query("select * from table3 where file_id = '$term2' AND id = '$t2'");
while (($row = mysql_fetch_array($sql)) && ($row_x = mysql_fetch_array($sql2)) && ($row_z = mysql_fetch_array($sql3)))
{
?>
<form>
<input name="fname" value="<?php echo $row['fname'];?>"></span> <br>
<input name="order" value="<?php echo $row_x['order'];?>"></span> <br>
<input name="item" value="<?php echo $row_z['item'];?>"></span> <br>
</form>
<?
}
?>