Jump to content

Echo table numbers


CEinNYC

Recommended Posts

Hey all -

 

What is the appropriate syntax to echo out each character name (vanity_name), and their total number of "ties" "wins" and "losses"

 

Thanks for your help!

	$q1 = "SELECT Wins, Ties, Losses from game_char WHERE vanity_name='mario'";
	$mario_sql = mysql_query($q1);

<?php echo "Mario: " . $mario_sql; ?>

 

 

[attachment deleted by admin]

Link to comment
Share on other sites


$query  = "SELECT vanity_name, Wins, Ties, Losses FROM game_char ORDER BY Wins DESC";
$result = mysql_query($query)or trigger_error("MySQL: " . mysql_error());

while($row = mysql_fetch_row($result))
{
echo <<<STATS
<pre>
<span style="font-weight:bold;">$row[0]</span>
Wins:    $row[1]
Ties:    $row[2]
Losses:    $row[3]
</pre>
STATS;
}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.