Priceless Posted September 16, 2012 Share Posted September 16, 2012 (edited) Hey, I'am currently working on mafiawars.. roll play in counter-strike source. I am working on printing "databases" into the php page. (query) But my php skills sucks (need/want webinterface). My table is small, and I really dont know how to make it any bigger.. here is my code : <html> <head> <title></title> </head> <body> <?php $db_host = ''; $db_user = ''; $db_pwd = ''; $database = ''; $table = ''; if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); $result = mysql_query("SELECT * FROM {$table}"); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); echo "<center><h1></h1></center>"; echo "<center><table border='5'><tr></center>"; for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); echo "<td>{$field->name}</td>"; } echo "</tr>\n"; while($row = mysql_fetch_row($result)) { echo "<tr>"; foreach($row as $cell) echo "<td>$cell</td>"; echo "</tr>\n"; } mysql_free_result($result); ?> </body> </html> And if I need a stylesheet can someone give an example? Thanks folx! <3 How can I make it lager.. would be awesome to have something simular to HG bans, or something like that (without the vb template if possible) Edited September 16, 2012 by Priceless Quote Link to comment Share on other sites More sharing options...
Guest The_Monkey Posted September 16, 2012 Share Posted September 16, 2012 I am a little confused at what you are trying to achieve. Quote Link to comment Share on other sites More sharing options...
Priceless Posted September 16, 2012 Author Share Posted September 16, 2012 I'am trying to print out the databases.. like okay, lets say sourcebans.. sourcebans prints of from database to yourlink/sourcebans/banlist.php or something like that. I want my database querys : from the database to a tabel on the page. (If you got another way to print out databases not in tables that would be 10 times better) I want either the table to be in a bigger size or I want the table to be diffrent. aka trying to make the template around the table and im trying to make the table appear another place, be a diffrent size & look better. and my current code sucks, and I havn't been much involved in php yet. Quote Link to comment Share on other sites More sharing options...
Guest The_Monkey Posted September 16, 2012 Share Posted September 16, 2012 So you are just trying to style the table? Quote Link to comment Share on other sites More sharing options...
Priceless Posted September 16, 2012 Author Share Posted September 16, 2012 Thanks money => Quote Link to comment Share on other sites More sharing options...
Guest The_Monkey Posted September 16, 2012 Share Posted September 16, 2012 Welcome. 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.