Jump to content

visionaire

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by visionaire

  1. Hello, I am working on a site where a user will input an email address, it will then need to be checked whether or not that email exists in a database, and only if it exists can the user continue. What I would like ideally is an input field where the user writes the email, then below that a line which shows either green for 'email found' or red 'email not found, try again'. I also want the user to be unable to continue if the email field is filled in, but giving the 'not found' message. I have been searching for hours for a tutorial on this, but so far could not find any. Any help would be greatly appreciated!
  2. The problem I see with this is the system will get very slow if I end up with 1000 matches and 10 breaks per match. It will be slow to do 'SELECT * FROM breaks WHERE MatchID="$ID"' for a table with 10.000 rows. Is there any way to avoid this?
  3. I am working on a site with snooker results. Each match is one row in a MySQL table, and somehow needs to contain the breaks (scores) that were made in each match. I am expecting the site to have many users, so I want to find an efficient way to do this. Let's say a match has 5 breaks in it, 50, 60, 70, 80 and 90. Another match only has 3: 20, 30, 40. I thought of storing them in the database as follows: '20;30;40' and then using PHP Implode to create an array when retrieving them. I want to, however, also be able to make a high break list, which would display 90, 80, 70, 60, 50, 40, 30, 20. I am however stuck on a way to combine the data from multiple matches and combine them into one list and then sort that list from high to low. Does anyone have any tips for this?
  4. Of course, my apologies My latest attempt is below: $query5=mysql_query("SELECT DISTINCT TournamentID FROM et_matches WHERE Player1='$ID' OR Player2='$ID'"); for(mysql_fetch_array($query5); !mysql_fetch_array($query5); ){ $query6=mysql_query("SELECT * FROM et_tourn WHERE ID='$TournamentID'"); $row6=mysql_fetch_array($query6); echo $row6['Name']."<br />"; echo "<table width='500' cellpadding=0 cellspacing='2' align='center' border=1>"; $query7=mysql_query("SELECT * FROM et_matches WHERE TournamentID='$TournamentID' AND (Player1='$ID' OR Player2='$ID')"); while($row7=mysql_fetch_array($query7)){ echo "<tr><td>". $row7['Player1Score']." ".$row7['Player2Score'] ."</td></tr>"; } } I have a feeling that using 'for' is the wrong approach though.
  5. I Have managed the above, many thanks! I am now running into another problem though. I have the following tables: 1. et_rank PlayerID - TournamentID - Ranking 2. et_tournaments Name - Location - Date 3. et_matches Player1ID - Player1Score - Player2ID - Player2Score - Round The way I want this to display data is as follows: Each player has a stats page, on these stats pages should be an overview of each tournament played, and all his matches in this tournament, layed out as follows: <Tournament 1 Name> <Match 1 Result> <Match 2 Result> <Tournament 2 Name> <Match 3 Result> <Match 4 Result> <Match 5 Result> The problem Im running into is I can't get it to only display the tournament name once, then show all matches with that tournament ID and player ID, then show the next tournament name once followed by all its matches. I keep getting outputs like: <Tournament 1 Name> <Tournament 2 Name> <Match 1 Result> <Match 2 Result> <Match 3 Result> <Match 4 Result> <Match 5 Result> I have been staring at this for over 3 hours now, and can't figure it out! Any help would be greatly appreciated!
  6. Thank you both for the replies! @Sock Puppet: Thanks for your help, what exactly do you mean by creating indexes on the columns? This is new to me
  7. Would this not create a very slow system if each table has literally 3000-4000 lines in it?
  8. Hello all, I am working on a webpage for a series of pool tournaments, and want to be able to show the ranking of players for every separate tournament, ie a list of 1st, 2nd, 3rd place and so on. The problem is the tour has been going for 20 years with 8 tournaments a year, so there have been an enormous amount of players and tournaments over the years. I will need a separate table with the players names, details etc, I could maybe use this in the rankings as well. A few things to keep note of: - Not every player has played in every tournament - Every tournament has a number of ranking points and an amount of prize money linked to the place in which a player finished (2000 euro, 500 points for number 1, 1000, 300 points for number 2 etc.) These have changed over the years, so need to be specified for each tournament. I am breaking my head over this, and don't even know where to start! Any help would be greatly appreciated, I'm hoping this would be fun for someone to figure out with me. Many thanks in advance, Ron
  9. Just what I needed, thank you so much! Is there a reason why sometimes I need to run it through mysql_query and sometimes I don't?
  10. I have a strange error from the code below. I have run the query with the resulting values in PHPMyAdmin and it works fine. The code is: $query = "SELECT * FROM sn_matches WHERE (P1_ID='".$P1_ID."' AND P2_ID='".$P2_ID."') OR (P1_ID='".$P2_ID."' AND P2_ID='".$P1_ID."')"; while($row = mysql_fetch_assoc($query)){ The error is: Line 21 is the one which has mysql_fetch_assoc on it. Any help would be much appreciated!
  11. Hello all, I am terribly confused about the following code, for some reason $tourn keeps going back to 0 for no reason! This code: <?php include 'header.php'; $tourn = $_GET['extourn']; echo "first ".$tourn."<br />"; if($tourn=0){ echo "tourn1 is ".$tourn."<br />"; } else{ echo "tourn2 is ".$tourn."<br />"; } ?> returns this: While tourn2 should return 4 as well. I have tried a million different versions, including switches and everything and just can't understand it. Please 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.