Forum Moderators: coopster
I think i could be the way i have done this but not to sure.
<a href=\"returnnote.php?row_ID=$id\">
this should send the row id to returnnote.php so that it can get it out of the data base, it seems to get the right id. See below
"http://localhost/returnnote.php?row_ID=5"
--------------------------------------------------------
<?php
include ("connection.php");
$RMA = $_POST['RMA'];
$id = $_POST['id'];
$row_ID = $_POST['row_ID'];
if(isset($_GET['RMA']) && $_GET['RMA']) $RMA = $_GET['RMA'];
else $RMA = 1;
//$query = "SELECT * FROM `rmatable` WHERE RMA = '$RMA' LIMIT 200";
$query15 = "SELECT * FROM rmatable WHERE RMA LIKE \"%$RMA%\" LIMIT 200";
$result15 = mysql_query($query15);
if($num=mysql_numrows($result15))
{
echo "<center>";
echo "<table style= width: 100%; >";
echo "<tr><td colspan=2 ><b>Results For $RMA</td></tr>";
echo "<td></table>";
echo "</center>";
while ($record = mysql_fetch_array($result15))
{
$id = $record["id"];
$RMA = $record["RMA"];
$CUSTOMER = $record["CUSTOMER"];
$MODULE = $record["MODULE"];
$SERIALNO = $record["SERIALNO"];
$WARR = $record["WARR"];
echo "<center>";
echo "<table style='width: 1000px; height: 52px;' border='3'>";
echo "<tr><td style='width: 245px; text-align: center;' nowrap><font size=-1 ><b>Comtech Module</td><td style='width: 82px; text-align: center;' nowrap><font size=-1 ><b>Serial No.</td><td style='width: 206px; text-align: center;'><font size=-1 ><b>Customer</td><td style='width: 90px; text-align: center;' nowrap><font size=-1 ><b>In Warranty</td><td style='width: 106px; text-align: center;' nowrap><font size=-1 ><b>Returns Note</td><td style='width: 100px; text-align: center;' nowrap><font size=-1 ><b>Warranty Note</td></tr>";
echo "<td style='width: 245px; text-align: center;' nowrap><font size=-1>$MODULE</td>";
echo "<td style='width: 82px; text-align: center;' nowrap><font size=-1>$SERIALNO</td>";
echo "<td style='width: 206px; text-align: center;' nowrap><font size=-1>$CUSTOMER</td>";
echo "<td style='width: 90px; text-align: center;' nowrap><font size=-1>$WARR</td>";
echo "<td style='width: 106px; text-align: center;' nowrap><a href=\"returnnote.php?row_ID=$id\"><font size=-1>Returns Note</a></td>";
echo "<td style='width: 100px; text-align: center;'><a href=\"warrantynote.php?row_ID=$id\"><font size=-1>Warranty Note</a></td></tr>";
echo "</table>";
echo "</center>";
}
}
?>
---------------------------------------------------------
---------------------------------------------------------
returnnote.php SCRIPT
---------------------------------------------------------
<?php
include ("connection.php");
$sql = "SELECT * FROM rmatable WHERE id = '$row_ID' LIMIT 0, 30";
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query))
{
$id = $row["id"];
$RMA = $row["RMA"];
$CUSTOMER = $row["CUSTOMER"];
$ADDRESSL1 = $row["ADDRESSL1"];
$ADDRESSL2 = $row["ADDRESSL2"];
$ADDRESSL3 = $row["ADDRESSL3"];
$ADDRESSL4 = $row["ADDRESSL4"];
$POSTCODE = $row["POSTCODE"];
$ADDRESSL5 = $row["ADDRESSL5"];
$CONTACT = $row["CONTACT"];
$RETURNREASON = $row["RETURNREASON"];
$FAULTDESCRIPTION = $row["FAULTDESCRIPTION"];
$MODULE = $row["MODULE"];
$SERIALNO = $row["SERIALNO"];
$FIXACTION = $row["FIXACTION"];
$JOBTIME = $row["JOBTIME"];
$COST = $row["COST"];
echo "<center>";
echo "<table style= width: 100%; >";
echo "<tr><td colspan=2 ><b>Returns Note For $RMA</td></tr>";
echo "<td><table>";
echo "<tr style ='height: 25px;'><td align=left><font size=-1 ><b>RMA Number :</td><td><font size=-1>$RMA</td></tr>";
echo "<tr valign=top style ='height: 35px;'><td align=left><font size=-1 ><b>Customer Name :</td><td><font size=-1>$CUSTOMER</td></tr>";
echo "<tr style ='height: 15px;'><td align=left><font size=-1 ><b>Address :</td><td><font size=-1>$ADDRESSL1</td></tr>";
echo "<tr style ='height: 15px;'><td align=left><font size=-1 ><b>Address :</tb><td><font size=-1>$ADDRESSL2</td></tr>";
echo "<tr style ='height: 15px;'><td align=left><font size=-1 ><b>Town :</td><td><font size=-1>$ADDRESSL3</td></tr>";
echo "<tr style ='height: 15px;'><td align=left><font size=-1 ><b>County :</th><td><font size=-1>$ADDRESSL4</td></tr>";
echo "<tr style ='height: 15px;'><td align=left><font size=-1 ><b>Postcode :</th><td><font size=-1>$POSTCODE</td></tr>";
echo "<tr valign=top style ='height: 35px;'><td align=left><font size=-1 ><b>Country :</th><td><font size=-1>$ADDRESSL5</td></tr>";
echo "<tr style ='height: 25px;'><td align=left><font size=-1 ><b>Contact Name :</th><td><font size=-1>$CONTACT</td></tr>";
echo "<tr style ='height: 25px;'><td align=left><font size=-1 ><b>Comtech Module :</th><td><font size=-1>$MODULE</td>";
echo "<td align=left><font size=-1 ><b>Serial Number :</th><td><font size=-1>$SERIALNO</td></tr>";
echo "<tr style ='height: 25px;'><td align=left><font size=-1 ><b>Reason for Return :</th><td><font size=-1>$RETURNREASON</td></tr>";
echo "<tr><td align=left valign=top style ='height: 100px;'><font size=-1 ><b>Fault Discription :</th><td valign=top><font size=-1>$FAULTDESCRIPTION</td></tr>";
echo "<tr><td align=left valign=top style ='height: 100px;'><font size=-1 ><b>Rectification/Action :</th><td valign=top style='width: 400px;'><font size=-1>$FIXACTION</td></tr>";
echo "<tr><td align=left><font size=-1 ><b>Job Time :</th><td><font size=-1>$JOBTIME</td>";
echo "<td align=left><font size=-1 ><b>Billable Cost :</th><td><font size=-1>$COST</td></tr>";
echo "</table>";
echo "</center>";
}
?>
---------------------------------------------------------
Any Ideas anyone?
[php.net...]
eelix
if($num=mysql_numrows($result15))
if($num=mysql_num_rows($result15))
eelix
You want to change
$row_ID = $_POST['row_ID'];
To
$row_ID = $_GET['row_ID'];
i don't know why i didn't see that to begin with
Good luck!
eelix
http://localhost/returnnote.php?row_ID=5
$RMA = (isset [php.net]($_GET['RMA'])) ? $_GET['RMA'] : 1;
$id = (isset [php.net]($_GET['id'])) ? $_GET['id'] : 0;
$row_ID = (isset [php.net]($_GET['row_ID'])) ? $_GET['row_ID'] : '';