Posted: Tue Mar 07, 2006 1:24 am
if you're using PHPMyAdmin, click on the table name, go to export, uncheck the data field, click go, and it'll give you the table structure in plain text 
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
-- phpMyAdmin SQL Dump
-- version 2.6.4-pl2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 07, 2006 at 07:36 AM
-- Server version: 4.0.25
-- PHP Version: 4.3.11
--
-- Database: `gaogier_site`
--
-- --------------------------------------------------------
--
-- Table structure for table `skill`
--
CREATE TABLE `skill` (
`id` int(10) NOT NULL auto_increment,
`name` varchar(50) NOT NULL default '',
`added` int(11) NOT NULL default '0',
`guideby` varchar(30) NOT NULL default '',
`contributors` varchar(225) NOT NULL default '',
`members` char(1) NOT NULL default 'N',
`mainbody` text NOT NULL,
`updated` int(11) NOT NULL default '0',
`sorter` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=3 ;Code: Select all
<?php
include('header.inc');
?>
<?
function skillview($id) {
require_once ('../mysql_connect.php');//connect to db
/* query for item */
$query = "SELECT * FROM skill WHERE id=$id";
$result = mysql_query ($query);
/* if we get no results back, error out */
$numrtn = mysql_num_rows($result);
if ($numrtn == 0) {
echo "The Skill guide requested cannot be found\n";
echo $id;
return;
}
$row = mysql_fetch_assoc($result);
/* easier to read variables and
* striping out tags */
$id = $row['id'];
$name = $row['name'];
$contributors = $row['contributors'];
$guideby = $row['guideby'];
$added = $row['added'];
$members = $row['members'];
$guide = $row['mainbody'];
$updated = $row['updated'];
if ($members == "Y") {
$mem = "members only Skill</b>, so it can only be done on a <b>members</b> server.";
}else{
$mem = "non-members Skill</b>.";
}
if ($updated == 0){
$up = 'No-one has updated this skill guide';
}else{
$date2 = date("l jS of F Y @ H:i:s ", $updated);
$up = 'It was last updated on '.$date2;
}
if ($contributors != ""){
$con = 'Thanks also to <b>'.$contributors.'</b> for changes.';
}else{
$con = 'No-one else has contributed to this Skill guide.';
}
//$date = date("D M jS, Y g:i a", $added);
$date = date("l jS of F Y @ H:i:s ", $added);
echo '
<div id="skill">
<p><span class="skillheader"><center>'.$name.'</center></span></p>
<p class="text">This skill guide was written by <b>'.$guideby.'</b> for use on Runehints and entered into the database on '.$date.'. '.$up.'. '.$con.' <br /></p>
<p><span class="text"><br />This skill is <b>'.$mem.'</span></p>
<p>
<p><span class="qtitles">Skill Guide:</span></p>
<span class="text">
<p>'.$guide.'</p>
</span>
</div> ';
}
function selectskill(){
require_once ('../mysql_connect.php');//connect to db
global $sitestyle;
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#000000" align="center" border="0" cellpadding="0" cellspacing="0" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/<?php echo $sitestyle.'_'; ?>tabletopl.jpg" height="25" width="30"></td>
<td background="images/<?php echo $sitestyle.'_'; ?>tabletopm.jpg" height="25"><div align="center"><font class="text"><b>Non-member's Skills</b></font></div></td>
<td background="images/<?php echo $sitestyle.'_'; ?>tabletopr.jpg" height="25" width="30"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/<?php echo $sitestyle.'_'; ?>tablemidl.jpg" width="16"></td>
<td bgcolor="#000000" align="left" border="0" cellpadding="0" cellspacing="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<?php
/* query for skills */
$n_query = "SELECT id, name, guideby, members, sorter FROM skill WHERE members='n' ORDER BY sorter ASC";
$n_result = mysql_query ($n_query);
while ($n_row = mysql_fetch_assoc($n_result)) {
$n_name = $n_row['name'];
$n_guideby = $n_row['guideby'];
$id = $n_row['id'];
/* place table row data in
* easier to use variables.
* & display the data */
echo '<tr><td width=100%><b><a href="skills.php?flibble=skillview&id='.$id.'&ic=1">'.$n_name.'</a></b></td><td><font class=small>'.$n_guideby.'</font></td></tr>';
}
/* finish up table*/
?>
</table>
</td>
<td background="images/<?php echo $sitestyle.'_'; ?>tablemidr.jpg" width="16"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="16"><img src="images/<?php echo $sitestyle.'_'; ?>tablebottoml.jpg" height="13" width="16"></td>
<td background="images/<?php echo $sitestyle.'_'; ?>tablebottomm.jpg" height="13"><img src="images/<?php echo $sitestyle.'_'; ?>tablebottomm.jpg" height="13" width="1"></td>
<td width="16"><img src="images/<?php echo $sitestyle.'_'; ?>tablebottomr.jpg" height="13" width="16"></td>
</tr>
</table>
</td>
<td width="16"></td>
<td bgcolor="#000000" align="center" border="0" cellpadding="0" cellspacing="0" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/<?php echo $sitestyle.'_'; ?>tabletopl.jpg" height="25" width="30"></td>
<td background="images/<?php echo $sitestyle.'_'; ?>tabletopm.jpg" height="25"><div align="center"><font class="text"><b>Member's Skills</b></font></div></td>
<td background="images/<?php echo $sitestyle.'_'; ?>tabletopr.jpg" height="25" width="30"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/<?php echo $sitestyle.'_'; ?>tablemidl.jpg" width="16"></td>
<td bgcolor="#000000" align="left" border="0" cellpadding="0" cellspacing="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<?php
/* query for skills */
$y_query = "SELECT id, name, guideby, members, sorter FROM skill WHERE members='y' ORDER BY sorter ASC";
$y_result = mysql_query ($y_query);
while ($y_row = mysql_fetch_assoc($y_result)) {
$y_name = $y_row['name'];
$y_guideby = $y_row['guideby'];
$id = $y_row['id'];
/* place table row data in
* easier to use variables.
* & display the data */
echo '<tr><td width=100%><b><a href="skills.php?flibble=skillview&id='.$yid.'&ic=1">'.$y_name.'</a></b></td><td><font class=small>'.$y_guideby.'</font><br /></td></tr>';
}
/* finish up table*/?>
</table>
</td>
<td background="images/<?php echo $sitestyle.'_'; ?>tablemidr.jpg" width="16"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="16"><img src="images/<?php echo $sitestyle.'_'; ?>tablebottoml.jpg" height="13" width="16"></td>
<td background="images/<?php echo $sitestyle.'_'; ?>tablebottomm.jpg" height="13"><img src="images/<?php echo $sitestyle.'_'; ?>tablebottomm.jpg" height="13" width="1"></td>
<td width="16"><img src="images/<?php echo $sitestyle.'_'; ?>tablebottomr.jpg" height="13" width="16"></td>
</tr>
</table>
</td></tr></table>
<?php
}
switch($_GET['flibble']) {
case 'selectskill':
selectskill();
break;
case 'skillview':
skillview($_GET['id']);
break;
default:
selectskill();
}
include('footer.inc');
?>