Jump to content

My Hack & Slash how can get this to display.


Defectuous

Recommended Posts

So a bit of information before I show my crappy php, This is for an online mmo I play called EVE Online. The information is pulled directly from the EVEAPI hourly and saved in a mysql DB. This PHP is slashed together from pieces I have found from multiple sources including here as well as phpMyAdmin to get the right information displayed. I try to sort this out myself, but I am stuck and cannot get this to display as I wish.

 

Header ( useless for this, but who knows it may be needed )

<?
require_once('config.php');
?>

 

Point in Page

<?php
$con = mysql_connect($server, $user, $pw);
mysql_select_db($db, $con);

$sLotto01 = mysql_query("SELECT `walletJournal`.`ownerName` , `walletJournal`.`amount` , `walletJournal`.`reason` FROM walletJournal");
  while ($row = mysql_fetch_assoc($sLotto01)) {
  print_r($row);
  echo "<br>";
}

?>

 

My results

 

Array ( [ownerName] => DenShou [amount] => 10 [reason] => Trial Lotto 01 )

Array ( [ownerName] => SheaLorin [amount] => 10 [reason] => Trial Lotto 01 )

Array ( [ownerName] => Pharacondie [amount] => 10 [reason] => Trial Lotto 01 )

Array ( [ownerName] => Pharamacisist [amount] => 10 [reason] => Trial Lotto 01 )

Array ( [ownerName] => DenShou [amount] => 10 [reason] => Trial Lotto 00 )

 

 

#### How I want it to display raw. before any html is applied to it.

 

Pharamacisist 10 Trial Lotto 01

DenShou 10 Trial Lotto 00

You need to look up associative arrays in php. I just hit the feeling lucky button on google search

http://www.informit.com/articles/article.aspx?p=31840&seqNum=3

 

To get this

'Pharamacisist 10 Trial Lotto 01'

 

echo $row['ownerName'] .' '. $row['amount'] .' '. $row['reason'];

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.