Forum Moderators: coopster
$query_rs = "SELECT * FROM info WHERE pid=$RemoteID";
$rs = mysql_query($query_rs, $server) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
<? do {
if $row_rs['infotype']==1 {
echo $row_rs['data']; }
} while ($row_rs = mysql_fetch_assoc($rs)); ?>
<? do {
if $row_rs['infotype']==2 {
echo $row_rs['data']; }
} while ($row_rs = mysql_fetch_assoc($rs)); ?>
<?php
$results=null;
$query_rs = "SELECT * FROM info WHERE pid=$RemoteID";
$rs = mysql_query($query_rs, $server) or die(mysql_error());
while ($row_rs = mysql_fetch_assoc($rs)) {
$col_1 = ($row_rs['infotype']==1)?$row_rs['data']:'-';
$col_2 = ($row_rs['infotype']==2)?$row_rs['data']:'-';
$col_3 = ($row_rs['infotype']==3)?$row_rs['data']:'-';
$results .= "<tr><td>$col_1</td><td>$col_2</td><td>$col_3</td></tr>\n";
}
//
if ($results) {
echo "
<table>
<tr><td>Heading 1</td><td>Heading 2</td><td>Heading 3</td></tr>
$results
</table>
";
}
else { echo "<p>Oops, no results.</p>"; }
?>
<?php
$results=$debug=null;
$debug .= "ID: $RemoteID<br>";
$query_rs = "SELECT * FROM info WHERE pid=$RemoteID";
$rs = mysql_query($query_rs, $server) or die(mysql_error());
while ($row_rs = mysql_fetch_assoc($rs)) {
$debug .= " id: " . $row_rs['id'] . " type: " . $row_rs['infotype'] . "<br>";
$col_1 = ($row_rs['infotype']==1)?$row_rs['data']:'-';
$col_2 = ($row_rs['infotype']==2)?$row_rs['data']:'-';
$col_3 = ($row_rs['infotype']==3)?$row_rs['data']:'-';
$results .= "<tr><td>$col_1</td><td>$col_2</td><td>$col_3</td></tr>\n";
}
//
if ($results) {
echo "
<table>
<tr><td>Heading 1</td><td>Heading 2</td><td>Heading 3</td></tr>
$results
</table>
$debug
";
}
else { echo "<p>Oops, no results.</p>"; }
?>
$results=null;
$query_rs = "SELECT * FROM phoneinfo WHERE pid=$RemoteID";
$rs = mysql_query($query_rs, $server) or die(mysql_error());
while ($row_rs = mysql_fetch_assoc($rs)) {
$col_1 = ($row_rs['infotype']==1)?$row_rs['data']:'';
$col_2 = ($row_rs['infotype']==2)?$row_rs['data']:'';
$col_3 = ($row_rs['infotype']==3)?$row_rs['data']:'';
$col_4 = ($row_rs['infotype']==4)?$row_rs['data']:'';
$col_5 = ($row_rs['infotype']==5)?$row_rs['data']:'';
$col_6 = ($row_rs['infotype']==6)?$row_rs['data']:'';
$col_7 = ($row_rs['infotype']==7)?$row_rs['data']:'';
$col_8 = ($row_rs['infotype']==8)?$row_rs['data']:'';
$col_9 = ($row_rs['infotype']==9)?$row_rs['data']:'';
$col_10 = ($row_rs['infotype']==10)?$row_rs['data']:'';
$results1 .= $col_1;
$results2 .= $col_2;
$results3 .= $col_3;
$results4 .= $col_4;
$results5 .= $col_5;
$results6 .= $col_6;
$results7 .= $col_7;
$results8 .= $col_8;
$results9 .= ($col_9!='')?"<ul><li>$col_9</li></ul>":'';
$results10 .= ($col_10!='')?"<ul><li>$col_10</li></ul>":'';
}
//
<h2>Heading 1</h2>
<?php echo "$results1'; ?>
<h2>Heading 2</h2>
<?php echo "$results2'; ?>
etc. $results1 = null;
$results2 = null;
$results3 = null;
$results4 = null;
$results5 = null;
$results6 = null;
$results7 = null;
$results8 = null;
$results9 = null;
$results10 = null;
$query_rs = "SELECT * FROM phoneinfo WHERE pid=$RemoteID";
$rs = mysql_query($query_rs, $Warehouse) or die(mysql_error());
while ($row_rs = mysql_fetch_assoc($rs)) {
$col_1 = ($row_rs['infotype']==1)?$row_rs['data']:'';
$col_2 = ($row_rs['infotype']==2)?$row_rs['data']:'';
$col_3 = ($row_rs['infotype']==3)?$row_rs['data']:'';
$col_4 = ($row_rs['infotype']==4)?$row_rs['data']:'';
$col_5 = ($row_rs['infotype']==5)?$row_rs['data']:'';
$col_6 = ($row_rs['infotype']==6)?$row_rs['data']:'';
$col_7 = ($row_rs['infotype']==7)?$row_rs['data']:'';
$col_8 = ($row_rs['infotype']==8)?$row_rs['data']:'';
$col_9 = ($row_rs['infotype']==9)?$row_rs['data']:'';
$col_10 = ($row_rs['infotype']==10)?$row_rs['data']:'';
$results1 .= $col_1;
$results2 .= $col_2;
$results3 .= $col_3;
$results4 .= $col_4;
$results5 .= $col_5;
$results6 .= $col_6;
$results7 .= $col_7;
$results8 .= $col_8;
$results9 .= ($col_9!='')?"<ul><li>$col_9</li></ul>":'';
$results10 .= ($col_10!='')?"<ul><li>$col_10</li></ul>":'';
}
//
<h2>Heading 1</h2>
<?php echo "$results1'; ?>
<h2>Heading 2</h2>
<?php echo "$results2'; ?>
etc.