Jump to content

Loops and Tables


Lamez

Recommended Posts

I need help bad, I have been at this for hours, and I am getting no luck.

 

Here is how I need help.

 

I have table that pulls out all the user picks, username, and total points.

 

here is how I want it:

 

Username | Lamez  | Anotheruser | MyUsername | tester |

--------------------------------------------------------------

2nd Round| TeamA | Team B      | Team C        | TeamD|

--------------------------------------------------------------

              |Team D | TeamG        | Team AD      | TeamL|

--------------------------------------------------------------

              |Team H | TeamY        | Team N        |TeamM|

--------------------------------------------------------------

 

and so on, but It does not look like that, I do not think I am putting my loop in the right place, could someone guide me where to put my other loop.

 

here is what I have so far:

 

<?php
include ("../../style/include/session.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<?php
$user = mysql_query("SELECT username FROM users");

$r = mysql_query("SELECT * FROM rnd1 WHERE username = '$user'");
$rnd1 = mysql_fetch_array($r);

$rto = mysql_query("SELECT * FROM userpoints WHERE username = '$user'");

?>


<table width="604" border="1">
  <tr>
    <td width="76">Username</td>
    <?php
 while($username = mysql_fetch_array($user)){
?>
    <td width="190"><?php echo $username['username']; ?></td>
<td width="316"> </td>
<?php 
}
?>
  </tr>
  <tr>
    <td>2nd Round </td>
    <td><?php echo $rnd1['a1']; ?></td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>

    <td> </td>
        <td> </td>
  </tr>
</table>
</body>
</html>

 

-Thanks Guys

Link to comment
https://forums.phpfreaks.com/topic/97737-loops-and-tables/
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.