Hi all:
I am attempting to do a WHILE loop with some variables mixed in as part of an IF statement! I think I made a mess, If anyoine could tell me how to properly do this it would be appreciated!
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/inc/dbconn_RO.php');
$iPid = $_GET["PID"];
if ($stmt = mysqli_prepare($link,
"
SELECT
AE.Player,
AE.Promoter,
AE.Exclusive,
AE.RepSince,
AE.Reference,
Promoters.PromoterFirstName,
Promoters.PromoterLastName,
Promoters.PromoterPhone,
Promoters.PromoterEmail,
AE.AE_ID,
Sports.Sport,
AE.AgreementEnd
FROM
Sports
INNER JOIN
(( AE INNER JOIN Promoters ON AE.Promoter = Promoters.Promoter)
INNER JOIN
Players ON AE.Player = Players.Player) ON Sports.SportCode = Players.SportCode
WHERE
Promoters.PromotersID = ?
ORDER BY
AE.Player
"
)) {
mysqli_stmt_bind_param($stmt, "s", $iPid);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $rPlayer, $rPromoter, $rExclusive, $rRepSince, $rReference, $rPromoterFirstName, $rPromoterLastName, $rPromoterPhone, $rPromoterEmail, $rAE_ID, $rSport, $rAgreementEnd);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
}
mysqli_close($link);
if(isset($rPlayer)){
while ($row = mysqli_stmt_fetch($stmt)) {
?>
<tbody id="tbodyresults">
<tr>
<td class="tdresults"><span class="redletter" style="font-weight:bold;"><?php echo $rPlayer ?></span><br /><?php echo $rSport ?></td>
<td class="tdresults"><span style="font-weight:bold;"><?php echo $rPromoter ?></span><br /><?php echo $rPromoterFirstName ?> <?php echo $rPromoterLastName ?><br /><?php echo $rPromoterPhone ?><br /><?php echo $rPromoterEmail ?></td>
<td class="tdresults">
<?php if($rExclusive == "Y" && $rAgreementEnd > Now()){echo "Yes";} else {echo "No";}?></td>
<td class="tdresults"><?php echo $rRepSince ?></td>
<td class="tdresults">
<?php if($rReference == "O"){echo "No";} else {echo "Yes";?>
</td>
<td class="tdresults"><a href="../aex_input.asp?AEID=<%=arrAE(9,i)%>&Promoter=<%=arrAE(1,i)%>&PID=<%=Request.QueryString("PID")%>&PromoterEmail=<%=arrAE(8,i)%>">Delete<br />and re-enter</a></td>
</tr>
</tbody>
<?php } ?>
</table>
</div>
<?php
} else {
echo "Please enter a correct Promoter ID";
}
require($_SERVER['DOCUMENT_ROOT'].'/inc/inc_column_r.txt');
require($_SERVER['DOCUMENT_ROOT'].'/inc/inc_footer.php');
?>