Jump to content

Caffeinenyx

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Caffeinenyx's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. * still returns game* results. First name etc is unique to rounds. Also none of them have the same number of results as game except game. Why game* results. It should only be looking a 1 game ID, which has say 8 people and entry ID's, hence 8 names.
  2. $PlayerQuery = "SELECT FirstName, SurName FROM players p, rounds m, entrants e, games t WHERE p.PlayerID = e.PlayerID AND m.GameID = '$ID' AND e.EntrantID = m.Player"; $PlayerResult = mysql_query($PlayerQuery); $PlayerRow = mysql_num_rows($PlayerResult); Can someone suggest why this returns game*the number of results. For each new game it returns an extra duplicate result. For example for 2 games: j Smith j Smith t John t John etc There are no duplicate entry's! and results should be unique. Not in a loop (positive)
  3. Blank screen. Also I have test using older files I use fine on windows and ubuntu 10.10 before I updated to 11.04. Nothing will run, so I assume it is not a parse error.
  4. I have a list of ID's returned from a table (even number). I always used a loop to get the next result, but I want to put these straight into a new table INSERT INTO table VALUES ($ID1, $ID2); This is recursive till there are no more ID's. How do I get the result then the next result without loops. ID1 and ID2 cannot be null. What is the best way?
  5. loops, sorry i am very over tried, I cant believe the mistakes I have made this evening. Thanks.
  6. I know im being blind today but can someone point out why: $query = "SELECT peopleID FROM numpeople WHERE ID = '3';"; $result = mysql_query($query) or die("failed."); $row = mysql_fetch_row($result); $numpeople = mysql_num_rows($result); echo "<br /> row $row[1]"; echo "<br />numpeople $numpeople"; $numpeople returns 2, but $row[1] is undefined? $row[0] is fine. (The value of $row[0] is 7 and $row[1] should be . This is the second error that I really cant see....
  7. Sorry, been coding for days to finish this - I think im going a bit insane! Im sure they had $ before.... The universe removed them! Thanks anyway for sorting my stupidity.
  8. No im not, its a weird font but they all start with $? $entrantQuery etc
  9. $entrantQuery = "SELECT entrantID FROM entrants WHERE Game = $idT"; $entrantResult = mysql_query(entrantQuery); $entrantRow = mysql_fetch_row(entrantResult); I have these at the start of my php (after getting $idT), but I get the error Notice: Use of undefined constant entrantQuery - assumed 'entrantQuery' in C:\Entrants.php on line .. Notice: Use of undefined constant entrantResult - assumed 'entrantResult' in C:\www\Entrants.php on line.. Ive used this code lots of times before, what am I missing? They are variables that I am defining!
  10. I have forum options in a loop (ie value = Entry$i) I need to call GET_POST('Entry$i') and loop though the INSERT query $i times. If I put GET_POST in a loop, however, it does not work. It does not give an INSERT failed error so I assume it is not reading it. I have also tried putting if GET_POST('Entry1') outside the loop, but it does not like it. I dont know how many options are needed so I need it to generate the correct number. Then you can select $i options from duplicated option lists. (Ie) participant 1, 2 and 3 from a list of possibles. I have also use GET_POST, I use a function. Other sumbits (I not use what they are called, please set me know), work fine on this page. echo "Entry $Number: <select name = \"Entry$j\">"; for ($i = 1; $i<$EntNum+1; $i++) { etc etc then for ($i = 0; $i<$NumberOfEntrys; $i++) { if (isset($_POST['AddEntry']) && isset($_POST["Entry$i"])) //rest of this bit not executed -just insert Ideas? Thanks
  11. I dont think the above is explained very well, also If I could add ORDER BY to topic... echo "<Option value = \"$i\">$PersonRows[0] $PersonRows[1] and $Person2Rows[0] $Person2Rows[1] </Option>"; I need to iterate though the results of $PersonRows[0] $PersonRows[1] and $Person2Rows[0] $Person2Rows[1] for each $i At the moment I get Andy Smith Andy Smith Andy Smith But I need Andy Smith Tim Carbrook Tom Steptoe etc, Also I have $Choicequery ="SELECT PersonA, PersonB FROM modules WHERE GroupID = '$UpdateNumber'"; or $Choicequery ="SELECT PersonA, PersonB,StartDate FROM modules WHERE GroupID = '$UpdateNumber'"; But if I add ORDER BY StartDate, it returns nothing? I really need them ordered.... Any ideas?, thanks
  12. I have got it now, i did need to define them as well, Thanks everyone!
  13. for ($i = 1; $i<$rows+1; $i++) { $Choicequery ="SELECT PersonA, PersonB FROM modules WHERE GroupID = '$UpdateNumber'"; $Choiceresult = mysql_query($Choicequery); $ChoiceRows = mysql_fetch_array($Choiceresult); $PersonQuery = "SELECT FirstName, LastName FROM Persons p, modules m, users e, group t WHERE m.modID = $ChoiceRows[0] AND e.UserID = m.PersonA AND p.PersonID = e.PersonID"; $PersonResult = mysql_query($PersonQuery); $PersonRows = mysql_fetch_array($PersonResult); $Person2Query = "SELECT FirstName, LastName FROM Persons p, modules m, users e, group t WHERE m.modID = $ChoiceRows[0] AND e.UserID = m.PersonB AND p.PersonID = e.PersonID"; $Person2Result = mysql_query($Person2Query); $Person2Rows = mysql_fetch_array($Person2Result); echo "<Option value = \"$i\">$PersonRows[0] $PersonRows[1] and $Person2Rows[0] $Person2Rows[1] </Option>"; } How do I get it to show the next result when $i increases? All the options are the first people A and B $i number of times. Not sure how to use a loop here to go though the results. Whats the best way? ie $PersonRows[0] $PersonRows[1] are the same for every option
  14. Unknown column 'table.PersonID' in 'on clause' ?? It is correct i can view the table
  15. SELECT oneID FROM table WHERE table.PersonID = game.PlayerA returns unknown column game.PlayerA but it does exist. Not a blank page, just this value missing, but it may have been the double quotes. Im fairly new to php and have never used table.anything (its a good idea)
×
×
  • 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.