Jump to content

Jim R

Members
  • Posts

    988
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jim R

  1. I actually came back to post the updated code. Sorry about that. Basically, I have three different queries(?) with three different SELECTS. (Not sure of the terminology.) <?php mysql_select_db("jwrbloom_hhr"); echo '<table class="playerTable" width="100%"> <thead> <tr> <th>#</th> <th>Top 10</th> <th>HT</th> <th>Level</th> <th>City (School)</th> <th>College</th> </tr> </thead> <tfoot> <tr> <td colspan="6" align="right">(+) moved up; (d) debut; (s) switched from another position</td> </tr> <tr> <td colspan="6" align="right">Colleges in bold print means committed</td> </tr> </tfoot> <tbody> '; $query = 'SELECT * FROM class2010 ORDER BY rankPOS ASC'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) { if ($line['group'] == 1) { echo '<tr> <td>'. $line['rankPos'] . $line['deviation'] . '</td> <td><a href="/wiki/index.php?title=' . $line['nameFirst'] . '_' . $line['nameLast'] .'" class="thickbox">'. $line['nameFirst'] . ' ' . $line['nameLast'] . '</a></td> <td><center>'. $line['height'] . '</center></td> <td><center>'. $line['level'] . '</center></td> <td>'. $line['hschool'] . '</td> <td>'. $line['college'] . '</td> </tr>';} } echo ' <tr> <td class="playerTable_head" colspan="6">The Best of the Rest</td> </tr>'; $query = 'SELECT * FROM class2010 ORDER BY nameLast ASC'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) if ($line['group'] == 2) { echo '<tr> <td>'. $line['deviation'] . '</td> <td><a href="/wiki/index.php?title=' . $line['nameFirst'] . '_' . $line['nameLast'] .'" class="thickbox" >'. $line['nameFirst'] . ' ' . $line['nameLast'] . '</a></td> <td><center>'. $line['height'] . '</center></td> <td><center>'. $line['level'] . '</center></td> <td>'. $line['hschool'] . '</td> <td>'. $line['college'] . '</td> </tr>';} echo ' <tr> <td class="playerTable_head" colspan="6">Names To Know</td> </tr>'; $query = 'SELECT * FROM class2010 ORDER BY nameLast ASC'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) if ($line['group'] == 3) { echo '<tr> <td>'. $line['deviation'] . '</td> <td><a href="/wiki/index.php?title=' . $line['nameFirst'] . '_' . $line['nameLast'] .'" class="thickbox" >'. $line['nameFirst'] . ' ' . $line['nameLast'] . '</a></td> <td><center>'. $line['height'] . '</center></td> <td><center>'. $line['level'] . '</center></td> <td>'. $line['hschool'] . '</td> <td>'. $line['college'] . '</td> </tr>';} echo '</tbody></table>'; ?>
  2. Can I continue this topic a little further? I know enough PHP to tinker with echo statements, but as for writing my own, my brain no longer functions with that kind of logic. As I'm dealing with "IF" commands, what I posted above, I have three separate sections from the same database. Section 1 is posted above, and as you can see the output is in a table. I will continue the table for sections 2 and 3. Should I repeat what I have above for sections 2 and 3, or is there a way of IF....AND...AND...? I don't think it's IF/else.
  3. Apparently Google doesn't like everybody... It usually likes me, but I was searching for equal signs, not comparative operators.
  4. Very nice. The == worked. The === yielded no results. At the risk of sounding lazy, what is the difference? I always thought == meant it didn't equal. I Googled it, but it didn't come up because they aren't words.
  5. Ok. I'm stuck on this. Why is the below not working? FYI, I have tried it with =1 and ="1". It still produces the same results, which is just printing the entire list. I"m not getting any errors. $query = 'SELECT * FROM class2010 ORDER BY rankPOS ASC'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) { if ($line['group'] = "1") {echo '<tr> <td valign="top">'. $line['rankPos'] . $line['deviation'] . '</td> <td valign="top"><a href="/wiki/index.php?title=' . $line['nameFirst'] . '_' . $line['nameLast'] .'">'. $line['nameFirst'] . ' ' . $line['nameLast'] . '</a></td> <td valign="top"><center>'. $line['height'] . '</center></td> <td valign="top"><center>'. $line['level'] . '</center></td> <td valign="top">'. $line['hschool'] . '</td> <td valign="top">'. $line['college'] . '</td> </tr>';}
  6. Lovemy, I appreciate your efforts, but none of those php settings apply to what I need and I can't make heads or tails of them. Certainly there has to be a way to take a normal hide/show script and place it within PHP.  I already have access to cookie and sessions.  In the code I provided, I'm able to determine which group the user is with.  From there I just need it to determine which layer to show and which layer to hide based on the group they're in. 
  7. ;) bump
  8. What I have is at the top of the code.  It's recognizing the php and just printing the echo statement.  Here is how the js function is called, but I tried that earlier too. onmousedown MM_showHideLayers('ss2008','','show')
  9. Maybe I'm not explaining myself clearly enough.  The schedules aren't in a database.  They are just put in a table in a layer.  Right now all four layers are set to "hidden".  I just want the code to determine which group the user is in, and from that determine which layer to "show". Something like this: [code] if (in_array(9, $user_info['groups']))   { echo 'showHideLayers(\'ss2008\',\'\',\'show\')';   } [/code] Only it's not working.  Instead of executing the code it just prints:  showHideLayer('ss2008', ' ', 'show')';
  10. Ninja, Thanks for answering. I'm using SMF actually and already have registration, cookies, membergroups, and permissions set up.  I'm using their membergroup and permission structure across my site.  I can easily set up code to control which pages they get to or what information to see, EXCEPT hiding and showing layers based on what membergroup they are with. If they are with SS2008, I want them to see SS2008's schedule.  If they are with SS2011, I want them to see SS2011's schedule.  IS2008 and IS2011...the same thing.  I have four different schedules, each in their own layer.  I want PHP to read what group/team they are wish and display the appropriate schedule.
  11. I searched and didn't find anything near what I was looking for.  Here is my issue: It's a website that deals with four basketball teams.  Each team has its own schedule, and I'm making them register to view some parts of the site.  When they register they can choose which Membergroup/team they are with.  I would like for them each to see their team's schedule when they visit the home page. I have hide/show toggles with onMouseDown commands for me (to be able to see all four), but what I can't seem to get to work is a code the differentiates which team they are on and shows the proper schedule as they visit the home page.  I've tried php code in the style script, as well as separate onLoad commands.  Neither worked. Thoughts?
×
×
  • 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.