07.08.2009, 02:02
I was hoping someone would be able to create me a script that would write information (bans) to a MySQL Database. I currently have this PHP script that retrieves the information and would like the PWN script to automatically put the ban in the separate rows of the database if someone is banned (/adban id reason). (Also, is it possible to put a date/time when the person was banned, if so, could you add that in as well?) Thanks in advance! Here is the PHP script, so you guys have the rows/w/e:
Код:
<?php mysql_connect("secret_database", "secret_user", "secret_password") or die(mysql_error()); echo "Connected to MySQL<br /><hr />"; mysql_select_db("secret_database") or die(mysql_error()); echo "Connected to Database<br /><hr />"; $query = "SELECT * FROM bans"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "<b>Name: </b>" . $row['Name'] . "<b> - Reason: </b>" . $row['Reason'] . "<b> - Admin: </b>" . $row['Admin'] . "<b> - IP: </b>" . $row['IP'] . "<b> - Date: </b>" . $row['Date']; echo "<br />"; } ?>