Browse Source

initial commit

getting started .....
development
mauirixxx 8 years ago
parent
commit
046b098523
3 changed files with 36 additions and 0 deletions
  1. +6
    -0
      gw-connect-sample.php
  2. +8
    -0
      gw-index.php
  3. +22
    -0
      gw-pull.php

+ 6
- 0
gw-connect-sample.php View File

@@ -0,0 +1,6 @@
<?php
define ("DATABASE_HOST", "localhost");
define ("DATABASE_USER", "not-root");
define ("DATABASE_PASS", "strong-password-here");
define ("DATABASE_NAME", "gwtreasuretracker");
?>

+ 8
- 0
gw-index.php View File

@@ -0,0 +1,8 @@
<?php
// tie everything together from here hopefully, might not even need the connection info?
include_once 'gw-connect.php';
$con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
?>

+ 22
- 0
gw-pull.php View File

@@ -0,0 +1,22 @@
<?php
$cname = "Chrissi Chan"; //need to make this a POST or GET variable
include_once 'gw-connect.php';
$con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
$sql = "SELECT * FROM `history` WHERE `charname` = '$cname' ORDER BY `historydate` ASC";
if (!$result = $con->query($sql)){
die ('There was an error running the query [' . $con->error . ']');
}
while ($row = $result->fetch_array()){
echo 'On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and ';
if (is_null($row['material'])) {
echo 'a ' . $row['itemrarity'] . ' req' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid <BR />';
} else {
echo 'a ' . $row['material'] . '!<BR />';
} //add another else statement to cover RUNES here
}
?>

<TITLE>Treasure Dates</TITLE>

Loading…
Cancel
Save