Page 2 of 2

Posted: Tue Mar 07, 2006 1:24 am
by s.dot
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 ;)

Posted: Tue Mar 07, 2006 1:36 am
by gaogier
oh, no i see,

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 ;

Posted: Tue Mar 07, 2006 1:40 am
by feyd
and skills?

Posted: Tue Mar 07, 2006 2:01 am
by gaogier
that is skills, you also want quests?

its going to be different

Posted: Tue Mar 07, 2006 2:01 am
by feyd
no, that's skill. You have a reference to skills as well.

Posted: Tue Mar 07, 2006 2:31 am
by shiznatix
he wants the CREATE TABLE not the select from table. to get that goto phpadmin (is that what its called?) or whatever you use to edit and create your tables and do a dump of the sql

Posted: Tue Mar 07, 2006 4:23 am
by gaogier
i worked out how to fix that problem, i now have to fix this

This skill guide was written by Gaogier for use on Runehints and entered into the database on Thursday 1st of January 1970 @ 01:00:00 . No-one has updated this skill guide. No-one else has contributed to this Skill guide.

and the title dose not show

Posted: Tue Mar 07, 2006 11:18 am
by septer 1
how do you get the time and date woking on the page?

Posted: Wed Mar 08, 2006 3:41 am
by gaogier
why is the date wrong? how can i set it up so its correct?

the php code:

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');
    ?>

Posted: Wed Mar 08, 2006 5:43 am
by mickd
Check out the date function from the PHP manual. It tells you exactly what each letter represents. Use this as a guide to customise it to your needs.

Posted: Fri Mar 10, 2006 1:16 pm
by gaogier
the date show up as i want, but it is Thursday 1st of January 1970 @ 01:00:00