Jump to content

Rick_Browne

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Rick_Browne's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I hope you can help me I use the following section of code to build a table of 50 by 50 squares- each square is populated with a name, its coordinates, and its type. [code]   $db = mysql_connect("*****", "*****", "*****");   mysql_select_db("contacts",$db); for($down=0;$down<50;$down++) {     echo "<tr>";              for($across=0;$across<50;$across++) {         $id = "$down,$across";         $result = mysql_query("SELECT * FROM coordinates WHERE id=$id",$db);         $myrow = mysql_fetch_array($result);         $name = $myrow["name"];         $type = $myrow["type"];         ?><td Width="100" Height="100">             <table border="0" align="center">                 <tr><td><center><?php printf("%s",$myrow["name"]) ?></center></td></tr>                 <tr><td nowrap><center><a href="?id=<?php echo $id?>">( <?php echo $id ?> )</a></center></td></tr>                 <tr><td><center><?php echo $type?></center></td></tr>             </table>         </td><?php         }     echo "</tr>";      } ?>[/code] The table builds itself fine and enters in all the correct coordinates- but the name and type fields remain empty. As you can see I have tried a different method for both to try and find a solution but my php is a bit rusty these days :( Im sure its something simple ive missed.....
×
×
  • 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.