Defectuous Posted January 12, 2010 Share Posted January 12, 2010 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 Link to comment https://forums.phpfreaks.com/topic/188143-my-hack-slash-how-can-get-this-to-display/ Share on other sites More sharing options...
knsito Posted January 12, 2010 Share Posted January 12, 2010 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']; Link to comment https://forums.phpfreaks.com/topic/188143-my-hack-slash-how-can-get-this-to-display/#findComment-993293 Share on other sites More sharing options...
trq Posted January 12, 2010 Share Posted January 12, 2010 while ($row = mysql_fetch_assoc($sLotto01)) { echo $row['ownerName'] . ' ' . $row['amount'] . ' ' . $row['reason'] . '<br>'; } Link to comment https://forums.phpfreaks.com/topic/188143-my-hack-slash-how-can-get-this-to-display/#findComment-993294 Share on other sites More sharing options...
Defectuous Posted January 12, 2010 Author Share Posted January 12, 2010 Awesom, @ knsito & thorpe , Saved the link & the source. now editing the page. Link to comment https://forums.phpfreaks.com/topic/188143-my-hack-slash-how-can-get-this-to-display/#findComment-993299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.