Thread: A little problem...

View Single Post

  #1 (permalink)  

Old 02-18-2005, 10:33 PM

A little problem...

If you go to http://www.melodeath.com , you will notice that the articles part of the stats displays absolutely nothing Here is the original code that I had, which for some godforsaken reason it didn't work:

PHP Code:
  <div class="nav">MeloDeath Statistics</div>
  <hr />
    <?
    
//define sql query and execute, gets the lyrics id...
        
$query mysql_query("SELECT * FROM lyrics ORDER BY id DESC LIMIT 1");
        
//loop through each array of data as $result
            
while($results mysql_fetch_array($query))
            {
            
?>
            Lyrics:  <? echo $results["id"?>
            <?
            
}
            
?>
            <?
    
//define sql query and execute, gets the article ID ...
        
$query1 mysql_query("SELECT * FROM articles ORDER BY id DESC LIMIT 1");
        
//loop through each array of data as $result
            
while($results1 mysql_fetch_array($query1))
            {
            
?>
            <br />Articles: <? echo $reslults1["id"?>
            <?
            
}
            
?>
            
  </div>
So yes, for some reason that didn't want to work for me at all. Oh well. Sicloan told me it would be easier to put some of that code into a seperate file and just include it in there, but if you go to http://www.melodeath.com/test you can see my dilema. This is what I changed that file to:

PHP Code:
<?php
require_once('functions/mysql_connect-lyrics.php');
include(
'funcitons/lyricstats.php');
include(
'functions/articlestats.php');
?>
<div id="left">
  <div class="nav">
   Navigation<br />
   </div><hr />
  <a href="http://www.melodeath.com/index.php">Home </a><br />
    <a href="http://www.melodeath.com/forums/index.php">Forums</a><br />
    <a href="http://www.melodeath.com/lyrics/index.php">Lyrics</a><br />
    <a href="http://www.melodeath.com/articles/index.php">Articles</a><br />
    <a href="http://www.melodeath.com/contact.php">Contact</a><br />
  <a href="http://www.melodeath.com/disclaimer.php">Disclaimer</a> 
  <div class="nav"> </div>
  <hr />
  <div class="nav">MeloDeath Statistics</div>
  <hr />
    Lyrics: <? echo $lyricstats["id"?><br />
    Articles: <? echo $articlestats["id"?>
            
  </div>
And then my included functions look like:

PHP Code:
<?
require_once('mysql_connect-lyrics.php');
    
//define sql query and execute, gets the article ID ...
        
$query mysql_query("SELECT * FROM articles ORDER BY id DESC LIMIT 1");
        
//loop through each array of data as $result
            
while($articlestats mysql_fetch_array($query))
                        
?>
The other function looks pretty similiar, only changed in certain places. Am I completely missing the point of functions?
__________________
[:: CursedProphets :: BlizzCenter :: VDCore :: MeloDeath :: Battleforums ::]


Cold was my soul
Untold was the pain
I faced when you left me
A rose in the rain....
So I swore to the razor
That never, enchained
Would your dark nails of faith
Be pushed through my veins again
[ reply ]
jd-inflames

jd-inflames is offline VDC Team Member

Join Date: Feb 2004

Location: Kentucky

Posts: 245

Send a message via AIM to jd-inflames