Jordan Palmer Posted December 12, 2009 Posted December 12, 2009 Hey all. I've been updating SeanyBobs Bug report system. I'm sick of seeing these one's around the forums with all this crap like urgency ect. I think it's un-needed and basically is just useless info... All copyrights go to SeanyBob. I've simply updated the code :) - Anyway here it is [mysql]CREATE TABLE IF NOT EXISTS `bugports` ( `brID` int(11) NOT NULL auto_increment, `brREPORTER` int(11) NOT NULL default '0', `brTEXT` longtext NOT NULL, `active` int(11) NOT NULL default '0', `time` varchar(40) NOT NULL default '0', PRIMARY KEY (`brID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;[/mysql] Create a file called Bugports.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. In staff_users.php Cases case 'breportsview': breports_view(); break; case 'brepclear': breport_clear(); break; add at the bottom function breports_view() { global $db,$ir,$c,$h,$userid; $time=date('F j Y, g:i:s a',$r['time']); print "<h3>Bug Reports</h3>"; echo "<table class='table' width='80%' border='1'>"; echo "<tr>"; echo "<th width='25%'>Reporter</th>"; echo "<th width='25%'>bug</th>"; echo "<th width='25%'>clear</th>"; echo "<th width='25%'>time reported</th>"; echo "</tr>"; $q=$db->query("SELECT br.*,u1.username as reporter FROM bugports br LEFT JOIN users u1 ON u1.userid=br.brREPORTER WHERE active=1 ORDER BY br.brID DESC",$c) or die(mysql_error()); while($r=mysql_fetch_array($q)) { print "\n<tr> <td>{$r['reporter']} [{$r['brREPORTER']}]</td>"; echo "<td>".stripslashes(htmlspecialchars($r['brTEXT']))."</td> <td>Clear</td> <td>$time</td> </tr>"; } //".time_format(time() - $r['time'])." print "</table>"; } function breport_clear() { global $db,$ir,$c,$h,$userid; $_GET['ID'] = abs((int) $_GET['ID']); $db->query("UPDATE bugports SET active=0 WHERE brID={$_GET['ID']}"); echo "Cleared > Back"; } This'll never delete any bugs from the database, It'll simple set it to NOT active bug and it wont appear in the bugs list I may once again update the code later this month ;] Quote
albenski Posted December 13, 2009 Posted December 13, 2009 database trouble when i try to add the SQL to the database i keep getting this Error SQL-query : CREATE TABLE IF NOT EXISTS `bugports` ( `brID` int( 11 ) NOT NULL auto_increment, `brREPORTER` int( 11 ) NOT NULL default '0', `brTEXT` longtext NOT NULL , `active` int( 11 ) NOT NULL default '0', `time` varchar( 40 ) NOT NULL default '0', PRIMARY KEY ( `brID` ) )ENGINE = MYISAM DEFAULTCHARSET = latin1 AUTO_INCREMENT = 7 MySQL said: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULTCHARSET = latin1 AUTO_INCREMENT = 7' at line 1 i had this prob before and i added them in 1 by 1 i cant do that this time any reason why ?( Quote
Jordan Palmer Posted December 13, 2009 Author Posted December 13, 2009 [mysql] CREATE TABLE `bugports` ( `brID` int(11) NOT NULL auto_increment, `brREPORTER` int(11) NOT NULL default '0', `brTEXT` longtext NOT NULL, `active` int(11) NOT NULL default '0', `time` varchar(40) NOT NULL default '0', PRIMARY KEY (`brID`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; [/mysql] Should work fine..if not drop me a email and ill check it over.. but worked for me Quote
Zero-Affect Posted December 15, 2009 Posted December 15, 2009 nice update mate. Hi Ho ;] I'm just human! I like to code just like most of us here. If you need help do not feel the need to aviod asking me. I ask myself a few noobie questions too! I know a fair deal about PHP so I should be able to help ;] Oh and... MERRY CHRISTMAS!! :P i love that by the way ^ Quote
Jordan Palmer Posted December 21, 2009 Author Posted December 21, 2009 @ albenski ; You'll have to contact you're hosting company as It's working fine for. Obv it's there side; @ Ghostriders159; Thanks just a quick update I did when I was bored @Zero-Affect ; Thanks ;] Quote
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.