marcus Posted January 10, 2007 Share Posted January 10, 2007 Make admin addon for a game I am making, hehe. Deleting news, the while statement is not spitting out the results.[code=php:0]//START...DELETE NEWS************if($act == deletenews){$nid = $_GET[nid]; if(!isset($nid)){ $sqlBB = "SELECT * FROM news ORDER BY id DESC"; $resAA = mysql_query($sqlBB) or die(mysql_error()); echo "<table border=0 cellspacing=3 cellpadding=2>\n"; echo "<tr><td class=boardB align=left>News Title<td class=boardB>Author<td class=boardB>Delete Link\n"; while($rowBB == mysql_fetch_array($resAA)){ echo "<tr><td class=boardB align=left>$rowBB[title]<td class=boardB>$rowBB[poster]<td class=boardB><a href='admin.php?act=deletenews&nid=$rowBB[id]'>Delete News ID #$rowBB[id]</a>\n"; } echo "</table>"; }else { $sql = "SELECT * FROM `news` WHERE `id` =$id"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0){ error("This news article does not exist!"); }else { $sql = "DELETE FROM `news` WHERE `id` =$id"; $res = mysql_query($sql) or die(mysql_error()); echo "This news article has been deleted!<br><a href='admin.php?act=deletenews'>Go Back</a>"; } }}//END....DELETE NEWS*************[/code] Link to comment https://forums.phpfreaks.com/topic/33541-while-statement-not-producing-results/ Share on other sites More sharing options...
Jessica Posted January 10, 2007 Share Posted January 10, 2007 $rowBB is never defined. Link to comment https://forums.phpfreaks.com/topic/33541-while-statement-not-producing-results/#findComment-157027 Share on other sites More sharing options...
marcus Posted January 10, 2007 Author Share Posted January 10, 2007 $rowBB == mysql_fetch_array($resAA)sure it is. Link to comment https://forums.phpfreaks.com/topic/33541-while-statement-not-producing-results/#findComment-157028 Share on other sites More sharing options...
magic2goodil Posted January 10, 2007 Share Posted January 10, 2007 == is a logical operator use = Link to comment https://forums.phpfreaks.com/topic/33541-while-statement-not-producing-results/#findComment-157031 Share on other sites More sharing options...
marcus Posted January 10, 2007 Author Share Posted January 10, 2007 Perfect, lol. Didn't see that. Thanks. Link to comment https://forums.phpfreaks.com/topic/33541-while-statement-not-producing-results/#findComment-157034 Share on other sites More sharing options...
magic2goodil Posted January 10, 2007 Share Posted January 10, 2007 No problem...click solved if it is working.. :) Link to comment https://forums.phpfreaks.com/topic/33541-while-statement-not-producing-results/#findComment-157052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.