Jump to content

kee1108

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by kee1108

  1. Hello, I am still relatively new to PHP, so I will have a clue if there is something on hand rather than writing from scratch. But I know eventually I will have to do that. Ok. So I am planning to write a script that works similarly to a sport draft. I will need people to login. Each member will be assigned a team. We will have a predetermined draft order and a pool of players for selection. As for the drafting itself, I will like to allow a member to be able to draft when they are on the clock, I will like to have just 1 result page, and it will get updated after each pick, and the player that gets drafted will be taken off the pool. I am not asking for any code, just I want to have someone to guide me to the right direction. What do I really need to achieve what I intended to build? And maybe some tutorial reference for similar tasks that I can look up. Thank you very much.
  2. As for the first issue, I am not even going to try to make my way to work. The way you suggested is a lot more neater . The PGID is now solved as well. THANKS. You are the man. I was trying to specific the table.column in the output portion. But instead selected only from the players table in the query will work. Thank you very much!!!
  3. Thank you very much for the quick respond. I did try LEFT OUTER JOIN, but I was trying to state the condition where RFA <> 'Yes' or something like that. Using IS NULL seems to do the trick. It works now. But I run into another problem. When I try to echo the PGID within a link, it doesn't work. I also tried players.PGID and still it doesn't add to the link. It was working before. <?php // Make a MySQL Connection mysql_connect("localhost", "root", "rootadmin") or die(mysql_error()); mysql_select_db("rzca-football_rzl") or die(mysql_error()); // Get specific results from the database $query = "SELECT * FROM players LEFT OUTER JOIN rfa ON players.PGID = rfa.PGID WHERE players.Contract_Left = '1' AND rfa.rfa IS NULL ORDER BY players.Team"; $result = mysql_query($query) or die(mysql_error()); ?> <div> <table border="0" class="smallplainWithBorder" cellpadding="2" cellspacing="0" width="600"> <tr class="darkback"> <td colspan="7" valign="bottom" class="statcell"><b><h1>Pontential Free Agent In 2013</h1></b></td> </tr> <?php while($row = mysql_fetch_array( $result )) { echo "<tr class='darkback'>"; echo "<td class=statcell>" . "<img src=http://rzl-football.com/files/images/icons/".$row['Team'].".gif>" . "</td>"; echo "<td class=statcell>" . "<a href=http://rzl-football.com/player.php?pgid=".$row['PGID'].">" . $row['First_Name'] . " " . $row['Last_Name'] . "</a></td>"; echo "<td class=statcell>" . $row['Pos'] . "</td>"; echo "<td class=statcell>" . $row['Age'] . "</td>"; echo "<td class=statcell>" . $row['HGT'] . "</td>"; echo "<td class=statcell>" . $row['WGT'] . "</td>"; echo "<td class=statcell>" . $row['OVR'] . "</td>"; echo "</tr>"; } ?> </table> </div>
  4. I have two tables, one has all the information, and the other one has all the row of a particular status. I tried to join them and then select from the result of the join. How should I do it? I am very new to php. Or is there a better way to do this. Table 1 has column (ID, Names, Contract_Left, etc), Table 2 has column (ID, RFA). Basically I just want the names with a contract left of 1 year who isn't a RFA. Table 2 only contains IDs for those who is RFA. <?php // Make a MySQL Connection mysql_connect("localhost", "USERNAME", "PW") or die(mysql_error()); mysql_select_db("rzca-football_rzl") or die(mysql_error()); // Get specific results from the database $query = "SELECT * FROM players LEFT JOIN rfa ON players.PGID = rfa.PGID UNION SELECT * FROM players RIGHT JOIN rfa ON players.PGID = rfa.PGID WHERE players.PGID IS NULL WHERE players.Contract_Left = '1' ORDER BY players.Team"; $result = mysql_query($query) or die(mysql_error()); ?> <div> <table border="0" class="smallplainWithBorder" cellpadding="2" cellspacing="0" width="600"> <tr class="darkback"> <td colspan="7" valign="bottom" class="statcell"><b><h1>Pontential Free Agent In 2013</h1></b></td> </tr> <?php while($row = mysql_fetch_array( $result )) { echo "<tr class='darkback'>"; echo "<td class=statcell>" . "<img src=http://rzl-football.com/files/images/icons/".$row['Team'].".gif>" . "</td>"; echo "<td class=statcell>" . "<a href=http://rzl-football.com/player.php?pgid=".$row['PGID'].">" . $row['First_Name'] . " " . $row['Last_Name'] . "</a></td>"; echo "<td class=statcell>" . $row['Pos'] . "</td>"; echo "<td class=statcell>" . $row['Age'] . "</td>"; echo "<td class=statcell>" . $row['HGT'] . "</td>"; echo "<td class=statcell>" . $row['WGT'] . "</td>"; echo "<td class=statcell>" . $row['OVR'] . "</td>"; echo "</tr>"; } ?> </table> </div> Thank you very much in advance. Any pointer will help.
  5. thank you. so if i have a long list of team, it is going to be a long code :) but guess this is the safest and easiest way to do it, haha thank you.
  6. yes i have table to store team id and team names. so i need a table for the images as well??
  7. if i have stored some team logos in a local folder, how can i get it to display the right team logo when i call for a particular team. what should i define? Thanks.
  8. I am planning to put the registration box on my top banner of my site, I am just wondering how can i do it with php, or is there a way, I am quite noob in php, I hope I don't put this is the wrong section again, meaning maybe it cannot be done by php :) Can someone guide me, thank you.
  9. How to use php to create a rolling news box Hope someone can help, thanks. -Ricky
  10. Hope someone can help me out. I have two tables in mysql, one is showing all the personal information of a group of athletes (also store an indicator to show wheather they are injured or not).  I am planning to create another table to store all the players with injuries and their type of injury. So my question is, is it possible if I want to call for a table for all the players that is with injuries (I want to show their info as well as the type of injury from the 2nd table.) Hope someone can help me out or give me some direction on how to do it. Or is there a easier way to do this? Thank you. -Ricky
  11. I have a css file with a lot of classes, but in certain pages, i don't want them to follow the main css, i want a different setting, how can i do that, i cannot get this to work. hope someone can help, thanks.
  12. Hi everyone, I just need some help, I want to know how to get a specific image from a local folder.  I dont' mind one image, but if I have 32 images which is correspond to 32 sport teams, how can I make the code so that it will pick the right image correspond to the team and I only have 1 team.php setup. Thanks for any help.
×
×
  • 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.