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] Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 10, 2007 Share Posted January 10, 2007 $rowBB is never defined. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted January 10, 2007 Share Posted January 10, 2007 == is a logical operator use = Quote Link to comment 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. Quote Link to comment 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.. :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.