Jump to content

Skipjackrick

Members
  • Posts

    196
  • Joined

  • Last visited

    Never

Everything posted by Skipjackrick

  1. I am having difficulty with the function: $_GET I tried to read some of the tutorials online but they are confusing. I am using the previous code but the form isn't populating once I press lookup. How does the $_GET function know what table to choose in the DB? The table that contains the data is called "user_info" Here is what I've got. <?php //Connect to MySQL $link = mysql_connect("localhost", "user", "pass") or die ("Check your server connection, could not connect to database"); //make sure we're using the right database mysql_select_db ("namelookup"); if($_GET['user_id']){ //Lookup info and store it into $c } ?> <html> <body> <form method="GET" action=""> Lookup By Contestant ID: <input type="text name="id" /> <input type="submit" value="Lookup" /><br /> </form> <hr> <form method="POST" action="submit_page.php"> Name: <input type="name" value="<?php echo htmlspecialchars($c['name']); ?>" /> etc </form> </body> </html>
  2. Wait, by reloading do you mean it will fill the info into the form after I click the submit button and the page will be re-displayed with the form fields populated? Or do you mean, once I enter the ID number and move the mouse, or hit tab to the next field on the form, the page would reload automatically with the info from the DB populated in the appropriate form fields?
  3. I don't want the page to reload, that will use up precious seconds. Basically, the contestant walks up to the table and tells me their ID number. I key in the 3 digit ID into the form. Information such as their name, what division they are entered in, age and location will auto-fill the form. This info would be queried from the DB. This way I can ask the person if their name is "John Smith" after they tell me the contestant ID number. Next, I would enter in the remainder of the necessary information into the form and hit submit. All of this data would be stored in an additional table on the DB. Refreshing the page or having an additional page would take too much time. I'll be entering data for over 600 contestants in less than an hour. Is AJAX my only hope?
  4. It seems that I could put a javascript action that says "on mouse over" or "on click" blah blah, query the DB and return the contestent name. Am I wrong? I don't know any AJAX.
  5. I have a DB table that contains Contestant ID numbers, and their name. When the contestant comes to Check-in I would like to enter the Contestant ID number and have the HTML form automatically populate a text box with the name of the contestant. Is this possible? Or do you know of a tutorial or subject that might cover this?
  6. HOLY CRAP!!!!!!!!! What a way to use SUM and IF together!!!!!!!!! You are amazing!!!!!!!!!!!!!!!!!!! I had figured out how to do it but I used about 100 different queries to fill each row and column separately. This simplifies it into 1 query!!!!!!!!!!!!!! THANKS A BILLION TIMES OVER!!!!!!!!!!!!!!!
  7. Well, I should be able to figure out some matter of accomplishing what I want to do without editing the database. I just haven't quite figured it out. I am certain that someone else has tried to arrange data in columns rather than rows and MySQL probably addressed that at some point. My problem is that I don't know the functions????????? Ahhh!!!
  8. Just so you can see how I am fetching my array I thought I'd include my thinking process behind it. <?php while($row = mysql_fetch_array($anglertotals)) { $anglerA = $row['anglerA']; $anglerB = $row['anglerB']; $anglerC = $row['anglerC']; $anglerD = $row['anglerD']; $anglerE = $row['anglerE']; $species_id = $row['species_id']; get_species($species_id); $kayakwars_totals2 .=<<<EOD <tr> <td align='center'>$speciesname</td> <td align='center'>$anglerA</td> <td align='center'>$anglerB</td> <td align='center'>$anglerC</td> <td align='center'>$anglerD</td> <td align='center'>$anglerE</td> </tr> EOD; } ?>
  9. Basically I am trying to arrange data across columns with a different "Group By" for each column. Is it possible to Fetch more than one array yet, put it in the same exact table???? Case #1 <?php $query_anglertotals = "SELECT species_id, COUNT(CASE WHEN angler = 'Oz' THEN species_id ELSE 0 END ) AS anglerA, COUNT(CASE WHEN angler = 'Skipjack' THEN species_id ELSE 0 END ) AS anglerB, COUNT(CASE WHEN angler = 'Curmit' THEN species_id ELSE 0 END ) AS anglerC, COUNT(CASE WHEN angler = 'Old Salt' THEN species_id ELSE 0 END ) AS anglerD, COUNT(CASE WHEN angler = 'Kip' THEN species_id ELSE 0 END ) AS anglerE FROM submit GROUP BY species_id ORDER BY species_id"; $anglertotals = mysql_query($query_anglertotals) or die(mysql_error()); ?> The first Case I posted gives me this..............Look at the Total catches by anglers table It gives me the total for each species of all of the entires. Well, Oz did not catch 108 redfish and neither did Skipjack. Click Here to See Case #1 Case #2 When I did this Oz is catching the correct amount of redfish but nobody else is catching anything. Click Here to See Case #2 <?php $query_anglertotals = "SELECT species_id, COUNT(species_id) AS anglerA FROM submit WHERE angler='Oz' GROUP BY species_id ORDER BY species_id"; $anglertotals = mysql_query($query_anglertotals) or die(mysql_error()); ?>
  10. Nope, I tried the following and I can't get it to work. Basically I am trying to arrange my data in columns rather than rows. <?php $query_anglertotals = "SELECT species_id, COUNT(species_id) AS anglerA FROM submit WHERE angler='Oz' GROUP BY species_id ORDER BY species_id COUNT(species_id) AS anglerB FROM submit WHERE angler='Skipjack' GROUP BY species_id ORDER BY species_id COUNT(species_id) AS anglerC FROM submit WHERE angler='Curmit' GROUP BY species_id ORDER BY species_id COUNT(species_id) AS anglerD FROM submit WHERE angler='Old Salt' GROUP BY species_id ORDER BY species_id COUNT(species_id) AS anglerE FROM submit WHERE angler='Kip' GROUP BY species_id ORDER BY species_id"; $anglertotals = mysql_query($query_anglertotals) or die(mysql_error()); while($row = mysql_fetch_array($anglertotals)) { $anglerA = $row['anglerA']; $anglerB = $row['anglerB']; $anglerC = $row['anglerC']; $anglerD = $row['anglerD']; $anglerE = $row['anglerE']; $species_id = $row['species_id']; get_species($species_id); $kayakwars_totals2 .=<<<EOD <tr> <td align='center'>$speciesname</td> <td align='center'>$anglerA</td> <td align='center'>$anglerB</td> <td align='center'>$anglerC</td> <td align='center'>$anglerD</td> <td align='center'>$anglerE</td> </tr> EOD; } ?>
  11. The following code is counting the species_id for every single entry in my DB. I only want it to count the entries for each specific angler. Why won't the following code work like I want? <?php $query_anglertotals = "SELECT species_id, COUNT(CASE WHEN angler = 'Oz' THEN species_id ELSE 0 END ) AS anglerA, COUNT(CASE WHEN angler = 'Skipjack' THEN species_id ELSE 0 END ) AS anglerB, COUNT(CASE WHEN angler = 'Curmit' THEN species_id ELSE 0 END ) AS anglerC, COUNT(CASE WHEN angler = 'Old Salt' THEN species_id ELSE 0 END ) AS anglerD, COUNT(CASE WHEN angler = 'Kip' THEN species_id ELSE 0 END ) AS anglerE FROM submit GROUP BY species_id ORDER BY species_id"; $anglertotals = mysql_query($query_anglertotals) or die(mysql_error()); ?>
  12. YAY! It works! Thanks for the help! This will save me hours in updating the site!
  13. Ah, when I ftp'd it up to the server it added all of these \par after every line. Is there a special way to upload .php files?
  14. Whoa! Thanks! But I get this error? Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/extremf3/public_html/Kayak_Wars/Dollar Yo/uploaded_files/menu.php on line 2 Parse error: syntax error, unexpected T_STRING in /home/extremf3/public_html/Kayak_Wars/Dollar Yo/uploaded_files/menu.php on line 2 Line 2 is just echo '<!-- wrap starts here -->
  15. I have a menu in my website that repeats for every single page. Sometimes I need to update or change this menu. Well, updating 50 pages with the exact same information is quite rediculous and I found out that you can use include to reference one menu file that would be included in every file. YAY! Anyways, I can't seem to get it to work. Wouldn't I just echo back the html?? I continue getting a parse error on this code I am trying to include. Is their another way to write html in php? Tutorial somewhere? In every page I have include 'menu.php'; menu.php <?php echo "<!-- wrap starts here -->"; echo "<div id="wrap">"; echo "<!--header -->"; echo "<div id="header">"; echo "<h1 id="logo-text"></h1>"; echo "<p id="slogan"></p>"; echo "<div id="header-links">"; echo "<p>"; echo "</p>"; echo "</div>"; echo "</div>"; echo "<!-- menu -->"; echo "<div id="menu">"; echo "<ul id="MenuBar1" class="MenuBarHorizontal">"; echo "<li><a class="MenuBarItemSubmenu" href="http://www.extremecoast.com/Kayak_Wars/index.php">Main </a>"; echo "<ul>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/index.php">Kayak Wars</a></li>"; echo "<li><a href="http://www.extremecoast.com/index.htm">Extremecoast</a></li>"; echo "</ul>"; echo "</li>"; echo "<li><a href="http://www.extremecoast.com/phpBB3/index.php">Forum</a></li>"; echo "<li><a class="MenuBarItemSubmenu" href="http://www.extremecoast.com/Kayak_Wars/standings.php">Standings</a>"; echo "<ul>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/standings.php">Team Standings</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/anglerstandings.php">Angler Standings</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/alltime.php">All Time Records</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/standings07.html">2007 Standings</a></li>"; echo "</ul>"; echo "</li>"; echo "<li><a class="MenuBarItemSubmenu" href="http://www.extremecoast.com/Kayak_Wars/submission.php">Info</a>"; echo "<ul>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/submission.php">Make a Submission</a></li>"; echo "<li><a href="http://extremecoast.com/phpBB3/viewtopic.php?f=5&t=10813">Sign Up a Team</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/points.html">Point Distribution</a></li>"; echo "</ul>"; echo "</li>"; echo "<li><a class="MenuBarItemSubmenu" href="http://www.extremecoast.com/Kayak_Wars/teams.php">Teams</a>"; echo "<ul>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Rockstar/uploaded_files/teampage.php">Rockstar</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Plastic%20Pirates/uploaded_files/teampage.php">Plastic Pirates</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Lone%20Star%20Sharkers/uploaded_files/teampage.php">Lone Star Sharkers</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Roadrunner/uploaded_files/teampage.php">Roadrunner</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Hawg%20Wild/uploaded_files/teampage.php">Hawg Wild</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Mojo/uploaded_files/teampage.php">Mojo</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/TAMUK%20Anglers/uploaded_files/teampage.php">TAMUK Anglers</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Krakatoa/uploaded_files/teampage.php">Krakatoa</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Why knot/uploaded_files/teampage.php">Why Knot</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Kraken/uploaded_files/teampage.php">Kraken</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Blue%20Desert/uploaded_files/teampage.php">Blue Desert</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Red%20Tide/uploaded_files/teampage.php">Red Tide</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/High%20Hopes/uploaded_files/teampage.php">High Hopes</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Academy/uploaded_files/teampage.php">Academy</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Wade%20Extreme%20Texas/uploaded_files/teampage.php">Wade Extreme Texas</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Islanders/uploaded_files/teampage.php">Islanders</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/SouthWest%20Paddle%20Sports/uploaded_files/teampage.php">SouthWest Paddle Sports</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Lucky%2013/uploaded_files/teampage.php">Lucky 13</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/King%20Mack%20Smack/uploaded_files/teampage.php">King Mack Smack</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Dollar%20Yo/uploaded_files/teampage.php">Dollar Yo</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Island%20Pride/uploaded_files/teampage.php">Island Pride</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Yak%20Bums/uploaded_files/teampage.php">Yak Bums</a></li>"; echo "<li><a href="http://www.extremecoast.com/Kayak_Wars/Big%20Jig/uploaded_files/teampage.php">Big Jig</a></li>"; echo "</ul>"; echo "</li>"; echo "<li class="last"><a href="http://www.extremecoast.com/Kayak_Wars/rules.html">Rules</a></li>"; echo "</ul>"; echo "</div>"; echo "<!-- content-wrap starts here -->"; ?>
  16. Ah, yeah, I forgot where's must be separated by AND That fixed it.. Thanks!
  17. This is obviously not the correct syntax for update because I keep getting an error. what do I have incorrect? <?php $result = mysql_query("UPDATE submit SET submit_id=175, team_id=17, angler='Ay Jay', species_id=5, points=10, length=0, yyyy=2008, mm=03, dd=30, image='rick1.jpg', region_id=1 WHERE submit_id=175, team_id=17, angler='Ay Jay', species_id=4, points=20, length=0, yyyy=2008, mm=03, dd=30, image='rick1jpg', region_id=1") or die(mysql_error()); ?>
  18. Currently I have a field on my db table called "length" Its set to "INT (255)" Well, lets say I have a length of "22.5" inches. When I enter "22.5" inches into the form it automatically rounds the number to "23" and stores it that way in the db. What would I change my field type to in order to accept decimal places??? Yet, still treat it as a number and not text?
  19. I figured it out. I forgot method="POST" In the form field
  20. I recently added a required fields form validation code and now my form won't submit. Can anybody check to see if I am missing something? HTML HEAD <script language="JavaScript"> <!-- /*********************************************** * Required fields validation ***********************************************/ function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("team_id", "species_id", "mm", "dd"); // Enter field description to appear in the dialog box var fieldDescription = Array("Team Name", "Species Name", "Month", "Day"); // dialog message var alertMsg = "Please complete the following fields:\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } } if (alertMsg.length == l_Msg){ return true; }else{ alert(alertMsg); return false; } } // --> </script> HTML BODY <?php if (isset($_POST['Submit'])) { $team_id = $_POST['team_id']; $angler = $_POST['angler']; $species_id = $_POST['species_id']; $points = $_POST['points']; $length = $_POST['length']; $yyyy = $_POST['yyyy']; $mm = $_POST['mm']; $dd = $_POST['dd']; $image = $_POST['image']; $region_id = $_POST['region_id']; # THIS CODE TELLS MYSQL TO INSERT THE DATA FROM THE FORM INTO YOUR MYSQL TABLE $sql = "INSERT INTO $db_table(submit_id, team_id, angler, species_id, points, length, yyyy, mm, dd, image, region_id) values ('$submit_id', '$team_id', '$angler', '$species_id', '$points', '$length', '$yyyy', '$mm', '$dd', '$image', '$region_id')"; if($result = mysql_query($sql ,$db)) { echo "<br>"; echo "Thank you, Your information has been entered into the database."; echo "<br>"; echo "<br>"; echo "<a href='http://www.extremecoast.com/Kayak_Wars/Rockstar/upload.form.php'>"; echo "Click here to make another submission"; echo "</a>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; } else { echo "ERROR: ".mysql_error(); } } else { ?> <form action="" enctype="multipart/form-data" name="form" id="form" onsubmit="return formCheck(this);" > <input type="hidden" name="submit_id" value="NULL"> <input type="hidden" name="region_id" value="1"> <tr> </tr><div align="center"></div><tr><td><div align="left" class="style2"></div></td> <td><label></label></td> </tr><tr><td> </td> </tr> <tr> <td> </td> <td><label></label></td> </tr> <tr> <td colspan="2"><div align="center"> <label></label> <label></label> <table width="600" border="0"> <tr> <td width="66" rowspan="5"> </td> <td width="168"><span class="style2 style1">Team</span></td> <td width="300"><select name="team_id" id="team_id" onChange="teamChange(this);"> <option value="0">Select a Team</option> <option value="1">Rockstar</option> <option value="2">Plastic Pirates</option> <option value="3">Lone Star Sharkers</option> <option value="4">Roadrunner</option> <option value="5">Hawg Wild</option> <option value="6">Mojo</option> <option value="7">TAMUK Anglers</option> <option value="8">Krakatoa</option> <option value="9">Why Knot</option> <option value="10">Kraken</option> </select></td> <td width="66" rowspan="5"> </td> </tr> <tr> <td><span class="style1">Angler</span></td> <td><select name="angler" id="angler"> <option value="0">Select Angler</option> </select></td> </tr> <tr> <td><span class="style1">Species</span></td> <td><select name="species_id" id="species_id" onChange="calc_points();"> <option value="0">Select Species</option> <option value="1">Red Drum</option> <option value="2">Trout</option> <option value="3">Snook</option> <option value="4">Shark</option> <option value="5">Black Drum</option> <option value="6">Snapper</option> <option value="7">King Mackerel</option> <option value="8">Grouper</option> <option value="9">Cobia (Ling)</option> <option value="10">Flounder</option> <option value="11">Tarpon</option> <option value="12">Tripletail</option> <option value="13">Permit</option> <option value="14">Blackfin Tuna</option> <option value="15">Yellowfin Tuna</option> <option value="16">Barracuda</option> <option value="17">Bonefish</option> <option value="18">Dorado</option> <option value="19">Wahoo</option> <option value="20">Billfish</option> <option value="21">Amberjack</option> </select> <span class="style1">Points</span> <input name="points2" type="text" id="points2" size="5" maxlength="4"><input name="points" type="hidden" id="points" size="5" maxlength="4"></td> </tr> <tr> <td><span class="style1">Enter Length (inches)</span></td> <td><input name="length" type="text" id="length" size="4" maxlength="5"> <span class="style1">Estimate if unknown</span></td> </tr> <tr> <td><span class="style1">Date of Catch</span></td> <td><select name="yyyy" id="yyyy"> <option value="2008" selected="selected">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> </select> <select name="mm" id="mm"> <option value="00">Select Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> <select name="dd" id="dd"> <option value="00">Select day</option> <option value="01">1</option> <option value="02">2</option> <option value="03">3</option> <option value="04">4</option> <option value="05">5</option> <option value="06">6</option> <option value="07">7</option> <option value="08">8</option> <option value="09">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select></td> </tr> <tr> <td height="68" colspan="4"> <div align="center"> <input type="Submit" name="Submit" class="button" id="Submit" value="Submit"> </div></td> </tr> </table> </div></td> </tr> <?php $query_image2 = "SELECT image_id, filename, team_id, date FROM image WHERE team_id=1 ORDER BY image_id DESC LIMIT 1"; $image_result2 = mysql_query($query_image2) or die(mysql_error()); while($row = mysql_fetch_array($image_result2)) { $imagename = $row['filename']; $display_image2 .=<<<EOD <input type="hidden" name="image" value="http://www.extremecoast.com/Kayak_Wars/Rockstar/uploaded_files/$imagename"> EOD; } print $display_image2; ?> </form> <?php $query_image = "SELECT image_id, filename, team_id, date FROM image WHERE team_id=1 ORDER BY image_id DESC LIMIT 1"; $image_result = mysql_query($query_image) or die(mysql_error()); while($row = mysql_fetch_array($image_result)) { $imagename = $row['filename']; $display_image .=<<<EOD <h2><div align="center"><img src="http://www.extremecoast.com/Kayak_Wars/Rockstar/uploaded_files/show_image.php?filename=$imagename&width=400&height=400"></div></h2> EOD; } echo "If this is not the image you intended to upload."; echo "<br>"; echo "<a href='http://www.extremecoast.com/Kayak_Wars/Rockstar/upload.form.php'>"; echo "Click here to change your image."; echo "</a>"; print $display_image; ?> <?php } ?>
  21. I have been reading and trying to figure this out but I am still not sure if I am headed the right direction. Would I use the following function?? mysql_fetch_row I am pretty sure that mysql_fetch_array is not going to work for me the way I have it listed above. All I need is a little kick. I can figure it out if I have a heading.
  22. I am having an extremely difficult time trying to figure out how to display some data in columns rather than in rows. Ok, I have the following data displayed like this. But I want the same exact data displayed like this. Does anybody have any pointers? Seems like a simple task to me? But I can't figure it out.... This is the code that I am using. <?php //connect to MySQL $link = mysql_connect("localhost", "*********", "**********") or die ("Check your server connection, could not connect to database"); //make sure we're using the right database mysql_select_db ("**********"); $bonus_header=<<<EOD <h2><Center>Total Number of Catches</center></h2> <table width='400' border='0' cellpadding='2' cellspacing='2' align='center'> <tr> <th>Species</th> <th>Team</th> <th>Total</th> </tr> EOD; $query_red = "SELECT species_id, team_id, COUNT(species_id) FROM submit WHERE species_id=1 GROUP BY team_id ORDER BY COUNT(species_id)DESC"; $result2 = mysql_query($query_red) or die(mysql_error()); while($row = mysql_fetch_array($result2)) { $team_id = $row['team_id']; $species_id = $row['species_id']; $redfish = $row['COUNT(species_id)']; $bonus_details .=<<<EOD <tr> <td align='center'>$speciesname</td> <td align='center'>$teamname</td> <td align='center'>$redfish</td> </tr> EOD; } $query_shark = "SELECT species_id, team_id, COUNT(species_id) FROM submit WHERE species_id=4 GROUP BY team_id ORDER BY COUNT(species_id)DESC"; $result3 = mysql_query($query_shark) or die(mysql_error()); while($row = mysql_fetch_array($result3)) { $team_id = $row['team_id']; $species_id = $row['species_id']; $shark = $row['COUNT(species_id)']; $bonus_details2 .=<<<EOD <tr> <td align='center'>$speciesname</td> <td align='center'>$teamname</td> <td align='center'>$shark</td> </tr> EOD; } $query_drum = "SELECT species_id, team_id, COUNT(species_id) FROM submit WHERE species_id=5 GROUP BY team_id ORDER BY COUNT(species_id)DESC"; $result4 = mysql_query($query_drum) or die(mysql_error()); while($row = mysql_fetch_array($result4)) { $team_id = $row['team_id']; $species_id = $row['species_id']; $drum = $row['COUNT(species_id)']; $bonus_details3 .=<<<EOD <tr> <td align='center'>$speciesname</td> <td align='center'>$teamname</td> <td align='center'>$drum</td> </tr> EOD; } $bonus_footer ="</table>"; $bonus_wars =<<<BONUS $bonus_header $bonus_details $bonus_details2 $bonus_details3 $bonus_footer BONUS; print $bonus_wars; ?>
  23. Thanks, Everything Works Perfect!
  24. Whoa COOL TRICK!! I am still Tiny Grasshopper....
×
×
  • 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.