Jump to content

cody4camp

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cody4camp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How would I make this where it only displays 50 rows, then has a <previous next> below it to show the next/previous 50 or so?
  2. Worked nicely. Thank-you for all your help today Blue.
  3. replacing with your code gives this: [attachment deleted by admin]
  4. function showcoords() { echo"J3st3r's CoordVision"; $result=dbquery("SELECT alliance, region, coordx, coordy FROM ".DB_COORDFUSION.""); echo "<table border='1'>"; // printing table headers echo "<tr>"; echo "<td>Alliance</td>"; echo "<td>Region</td>"; echo "<td>Coord</td>"; echo "</tr>\n"; // printing table rows while($row = mysql_fetch_array($result)) { foreach($row as $Cell) { echo "<tr>"; echo "<td>".$row['alliance']."</td>\n"; echo "<td>".$row['region']."</td>\n"; echo "<td>".$row['coordx'].",".$row['coordy']."</td>\n"; echo "</tr>\n"; } } echo "</table>"; mysql_free_result($result); } Done what you mentioned, and now it displays the same row 8 times.
  5. I know I'm doing it something right, but can someone tell me why only one table is showing up? Can you help me fix the issue? Heres my code: function showcoords() { echo"J3st3r's CoordVision"; $result=dbquery("SELECT alliance, region, coordx, coordy FROM ".DB_COORDFUSION.""); dbarray($result); $fields_num = mysql_num_fields($result); echo "<table border='1'>"; // printing table headers echo "<td>Alliance</td>"; echo "<td>Region</td>"; echo "<td>Coord</td>"; // printing table rows while($row = mysql_fetch_array($result)) { // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row AS $Cell) echo "<tr>"; echo "<td>".$row['alliance']."</td>\n"; echo "<td>".$row['region']."</td>\n"; echo "<td>".$row['coordx'].",".$row['coordy']."</td>\n"; echo "</tr>\n"; } echo "</table>"; mysql_free_result($result); } I have 2 rows inserted into my coords table. Just frustrated and ignorant to php.
  6. $result=dbquery("SELECT alliance, region, coordx, coordy, ABS(sqrt(($playerx - coordx) ^ 2 + ($playery - coordy) ^ 2)) AS distance FROM ".DB_COORDFUSION." ORDER BY distance LIMIT 25"); Also, the distance shows up in the table aswell. here is what it returns:4294967296
  7. Oops, not solved. The distance is getting returned the same for each coord.
  8. Excuse me for my ignorance, but how will I sort out the lowest ones closest to my number?
  9. I am designing a mmorpg guild site, and decided to make a coordinate database. A user will enter their own coords, x and y, and the 10 closest coords to them will be displayed. I need help doing this. My table is: id coordx coordy alliance region I am using $_GET to retrieve the user's input. so $_GET['mex'] $_GET['mey'] Thanks in advance for your help.
  10. I am designing a mmorpg guild site, and decided to make a coordinate database. A user will enter their own coords, x and y, and the 10 closest coords to them will be displayed. I need help doing this. My table is: id coordx coordy alliance region I am using $_GET to retrieve the user's input. so $_GET['mex'] $_GET['mey'] Thanks in advance for your help.
  11. well actually i got the table wrong its users. SOLVED, thanx to Maq and revraz
  12. ive edited alot, now i only got this error:
  13. error Notice: Undefined variable: tab in /home/cody4cam/public_html/offerpal.php on line 13 Warning: mysql_query() [function.mysql-query]: Access denied for user 'cody4cam'@'localhost' (using password: NO) in /home/cody4cam/public_html/offerpal.php on line 13 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/cody4cam/public_html/offerpal.php on line 13 Access denied for user 'cody4cam'@'localhost' (using password: NO)
×
×
  • 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.