We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Custom Databases?; Can you create them for my board... 3 of them.....
Topic Started: Aug 21 2010, 09:27 PM (506 Views)
Gangstafier
Member
[ * ]
Okay, well, I am currently working on a system that should help save the admins some time on another board, it uses PHP and MySQL, I have the PHP code done, it's just that It needs a database premade, and access to the config.php file to that database... here is the coding that would need turned into tables withen the database.

Code:
 
CREATE TABLE IF NOT EXISTS `brawl` (
`username` varchar(255) NOT NULL,
`squad` varchar(255) NOT NULL,
`FC` varchar(255) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;

Code:
 
CREATE TABLE IF NOT EXISTS `mwr` (
`username` varchar(255) NOT NULL,
`squad` varchar(255) NOT NULL,
`FC` varchar(255) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;

Code:
 
CREATE TABLE IF NOT EXISTS `mkwii` (
`username` varchar(255) NOT NULL,
`squad` varchar(255) NOT NULL,
`FC` varchar(255) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;

Then this is the code I have used to add info to those databases...

Code:
 
<?
include_once"config.php";
if(isset($_POST['submit'])){
$username = $_POST['username'];
$squad = $_POST['squad'];
$FC = $_POST['FC'];
$create_member = mysql_query("INSERT INTO `brawl` (`username`, `squad`, `FC`)
VALUES('$username','$squad','$FC')");
}
?>

Code:
 
<form action="" method="POST">
<input type="text" size="12" maxlength="20" name="username" id="username" value="Username"/>
   <select id="squad" name="squad">
<option selected="selected">Air Squad</option>
<option>Earth Squad</option>
<option>Fire Squad</option>
<option>Water Squad</option>
</select>   <input type="text" size="12" name="FC" maxlength="20" id="FC" value="FriendCode"/>
  <br />
<input type="submit" name="submit" id="submit" value="Submit"/>
<input type="reset" name="reset" id="reset" value="Reset"/>
</form>

And this is the code I am using to recall the info from the databases...

Code:
 
<table><tr><td><b><i>Name</b></i></td><td><b><i>Squad</b></i></td><td><b><i>Friend Code</b></i></td ></tr>
<?
$list_members = mysql_query("SELECT * FROM `brawl` ORDER BY squad");
$list = mysql_fetch_array( $list_members );
while($list = mysql_fetch_array( $list_members ))
{
Print '<tr><td>';
Print "".$list['username']."</td><td>".$list['squad']."</td><td>".$list['FC']."</td></tr>";
}
?>
</div>
</table>


Is there any way you would create custom tables into the main database for me please?
Offline Profile Quote Post Goto Top
 
HolySavior
Member Avatar
if( holy + alcohol){ happycoding()}
[ *  *  *  *  *  *  * ]
unfortunately this wont happen. however if you have a host you can use JS to help run the php and mysql data on your board and host.

you can also easily have 1 table to hold all that information too :P
Offline Profile Quote Post Goto Top
 
Brandon
Member Avatar


ZetaBoards and InvisionFree are carefully tuned for database performance. Allowing arbitrary new tables and queries would make a huge mess of performance and security.

To illustrate the point, putting a PRIMARY KEY on a varchar(255) field is a huge waste of resources.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Service Discussion and Feedback · Next Topic »
Add Reply