WatsonN Posted October 27, 2010 Share Posted October 27, 2010 In my script it is supposed to display the info in the VIEW is set to 2. But since i put the if 'UL' > 3 above it it will only display the else and I'm not sure why it is doing this. $view = mysql_query("SELECT * FROM YBK_Login WHERE `ID` = '{$_COOKIE['UID_WatsonN']}'") or die(mysql_error()); while($infos = mysql_fetch_array( $view )) If ($infos['UL'] > "3") { Print' <form action="post.php" method="post"> <select name="view"> <option value="1">User</option> <option value="2" SELECTED>Admin</option> </select> <input type="submit" value="Set View" name="admin-view"> </form>'; } If ($infos['VIEW'] == "2") { $data = mysql_query("SELECT * FROM YBK_Ads WHERE `delete` = '0' ORDER BY ID LIMIT $offset, $rowsperpage") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { $ID = $info['ID']; ?> <div id="content"> <div class="post"><a name="<?php Print $ID; ?>"> <h2 class="title"><a href="#<?php Print $ID; ?>"><?php Print $info['BSN']; ?></a></h2> <p class="meta"><span class="author"><a href="/user?UID=<?php Print $info['UID']; ?>"><?php Print "By: ".$info['UID']; ?></a></span> <span class="date"><?php Print $info['Date']; ?></span> <span class="links"><a href="#<?php Print $ID; ?>" title="">Ad ID: <?php Print $ID; ?> </a><br> <form name="YBK-payment" action="post.php" method="post"> <input type="hidden" name="ID" value="<?php Print $ID ?>"> <select name="status"> <option value="Not Sent">Not Sent</option> <option value="Bill Sent" SELECTED>Bill Sent</option> <option value="Check to be cashed">Check TBC</option> <option value="Paid">Paid</option> <option value="Temporarily Declined">T Decl</option> <option value="Permanently Declined">P Decl</option> <option value="Delete">Delete</option> </select> </select> <input type="submit" value="Update Status" name="payment"> </form> </ul><br> <?php Print "Payment Status: <b>".$info['payment'] . "</b>"; ?> </span></p> <div class="entry"> <form id="form_25488_2" method="post" action="http://ybk.watsonn.com/post-add.php"><input type="hidden" name="id" value="<?php echo $ID; ?>"> <ul > <li id="li_7" > <label class="description" for="element_7">Contact Name </label> <span> <input id="element_7_1" name= "element_7_1" class="element text" maxlength="255" size="8" value="<?php echo $info['CNF']; ?>"/> <label>First</label> </span> <span> <input id="element_7_2" name= "element_7_2" class="element text" maxlength="255" size="14" value="<?php echo $info['CNL']; ?>"/> <label>Last</label> </span> </li> <li id="li_2" > <label class="description" for="element_2">Address </label> <div> <input id="element_2" name="element_2" class="element text medium" type="text" maxlength="255" value="<?php echo $info['ADD']; ?>"/> </div> </li> <li id="li_3" > <label class="description" for="element_3">City </label> <div> <input id="element_3" name="element_3" class="element text medium" type="text" maxlength="255" value="<?php echo $info['CITY']; ?>"/> </div> </li> <li id="li_4" > <label class="description" for="element_4">State </label> <div> <input id="element_4" name="element_4" class="element text medium" type="text" maxlength="255" value="<?php echo $info['STATE']; ?>"/> </div> </li> <li id="li_5" > <label class="description" for="element_5">Zip </label> <div> <input id="element_5" name="element_5" class="element text medium" type="text" maxlength="255" value="<?php echo $info['ZIP']; ?>"/> </div> </li> <li id="li_5" > <label class="description" for="element_5">Declined Ad </label> <div> <input id="element_5" name="DCL" class="element text medium" type="text" maxlength="3" value="<?php echo $info['DCL']; ?>"/> </div> </li> <li id="li_5" > <label class="description" for="element_5">Call Back Next Year </label> <div> <input id="element_5" name="CB" class="element text medium" type="text" maxlength="3" value="<?php echo $info['CB']; ?>"/> </div> </li> <li id="li_10" > <?php Print "Type of Ad:<b> ".$info['ToA'] . "</b><br>"; ?> <li id="li_13" > <label class="description" for="element_13">Ad Size </label> <span> <input id="element_13" name="element_13" class="element radio" type="text" value="<?php echo $info['AS']; ?>" /><br> <small>1/8 1/4 1/2 Full</small></p> </span> </li> <li id="li_11" > <label class="description" for="element_11">Payment Type </label> <span> <input id="element_11" name="element_11" class="element radio" type="text" value="<?php echo $info['PT']; ?>" /> </span> </li> <li id="li_6" > <label class="description" for="element_6">Check Number (If Applicable) </label> <div> <input id="element_6" name="element_6" class="element text medium" type="text" maxlength="255" value="<?php echo $info['CN']; ?>"/> </div> </li> <li id="li_12" > <label class="description" for="element_12">Buying a Yearbook </label> <span> <input id="element_12_1" name="element_12" class="element radio" type="text" value="<?php echo $info['BY']; ?>" /> </span> </li> <li id="li_8" > <label class="description" for="element_8">Ad Copy • Artwork/Photo Instructions </label> <div> <textarea COLS="45" ROWS="5" style="overflow: visible; white-space: wrap;" id="element_8" name="element_8" class="element textarea medium"><?php echo stripslashes($info['ACI']); ?></textarea> </div><p class="guidelines" id="guide_8"><small>Artwork needs to be black or a dark color on a white background</small></p> <p></p> <dd><dd> <a href="image?id=<?php Print $ID ?>">Upload an image</a><? Print " "; Print $info['image'] ?> </li> <?php Print "<li>Talked to Ad Manager:<b> ".$info['TAM'] . "</b><br></li>"; Print "<li>Left A Voicemail: <b>".$info['VM'] . "</b><br></li>"; ?> <input type="submit" name="Update" value="Update" /> </ul> </form> </div> <?php } ?> </div> <?php } else { $data = mysql_query("SELECT * FROM YBK_Ads WHERE `delete` = '0' ORDER BY ID LIMIT $offset, $rowsperpage") or die(mysql_error()); while ($info = mysql_fetch_assoc($data)) { $ID = $info['ID']; ?> <div id="content"> <div class="post"><a name="<?php Print $ID; ?>"> <h2 class="title"><a href="#<?php Print $ID; ?>"><?php Print $info['BSN']; ?></a></h2> <p class="meta"><span class="author"><a href="/user?UID=<?php Print $info['UID']; ?>"><?php Print "User ID: ".$info['UID']; ?></a></span> <span class="date"><?php Print $info['Date']; ?></span> <span class="links"><a href="#<?php Print $ID; ?>" title="">Ad ID: <?php Print $ID; ?> </a><br> </ul><br> <?php Print "Payment Status: <b>".$info['payment'] . "</b>"; ?> </span></p> <div class="entry"> <p>Contact Name: <?php Print "<b>" . $info['CNF'] ." " . $info['CNL'] . "</b><br>";?> <?php Print "Address: <b>".$info['ADD'] . "</b><br>"; Print "City: <b>".$info['CITY'] . "</b><br>"; Print "State:<b> ".$info['STATE'] . "</b><br>"; Print "Zip:<b> ".$info['ZIP'] . "<br></b>"; Print "Declined Ad:<b> ".$info['DCL'] . "<br></b>"; Print "Call Back Next Year:<b> ".$info['CB'] . "<br></b>"; Print "Type of Ad:<b> ".$info['ToA'] . "</b><br>"; Print "Ad Size:<b> ".$info['AS'] . "<br></b>"; Print "Payment Type:<b> ".$info['PT'] . "</b><br>"; Print "Check Number:<b> ".$info['CN'] . "</b><br>"; Print "Buying a yearbook:<b> ".$info['BY'] . "</b><br>"; Print "Ad Copy • Artwork/Photo Instructions:<b><pre> ".stripslashes($info['ACI']) . "</pre></b><br>"; Print "Image: <b>" . $info['image'] . "</b><br>"; Print "Talked to Ad Manager:<b> ".$info['TAM'] . "</b><br>"; Print "Left A Voicemail: <b>".$info['VM'] . "</b><br>"; ?> </p> </div> <?php } ?> </div> <?php } Link to comment https://forums.phpfreaks.com/topic/217055-not-displaying-the-if-data/ Share on other sites More sharing options...
btherl Posted October 28, 2010 Share Posted October 28, 2010 Your outermost while loop is missing the opening and closing braces, the "{" and "}". As a result, only the "if ul > 3" is within the while loop, and the "if view == 2" is not. Link to comment https://forums.phpfreaks.com/topic/217055-not-displaying-the-if-data/#findComment-1127331 Share on other sites More sharing options...
WatsonN Posted October 28, 2010 Author Share Posted October 28, 2010 Perfect! Thank ya much Link to comment https://forums.phpfreaks.com/topic/217055-not-displaying-the-if-data/#findComment-1127347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.