Jump to content

Duplicate display from SELECT?


doomdude

Recommended Posts

Hey guys, not sure what's gone wrong here, but this displays the select query twice on my page.

 

<?php	


        $result = mysql_query("SELECT * FROM members WHERE Username='$_SESSION[username]'") 
                or die(mysql_error());  

    	while($row = mysql_fetch_array( $result )) {    

			echo '<b>Resources</b><br />';
                echo 'Wood: ' . $row['res1'] . ' <br />';
			echo 'Iron: ' . $row['res2'] . ' <br />';
        } 

?>

 

Displays as:

 

Resources

Wood: 2000

Iron: 1000

Resources

Wood: 0

Iron: 0

 

The first set of numbers are correct, but I'm not sure where the second lot are been called from?

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/247828-duplicate-display-from-select/
Share on other sites

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.