![]() |
|
#1
|
|||
|
|||
Organizing selected dataHi,
I am trying to organize selected data. As it was it printed to the page, the individual row information all clumped together in one long string. A new line started with every different person I added but their information was end to end. I tried formatting a table to accomadate the information but now it lists individual attributes in rows, which does not work as my "descriptions" are written across the top. My table is a name and address directory and I would like to be able to sort the individual's attributes id, first, last,email,etc all on one line but separated into cells or spaced out enough that it does not look like encripted code. Here is my script: $query = "SELECT * FROM family_info"; $result = mysqli_query($connection,$query); if (!$result){ exit("<b>unable to retrieve family_info mysql_error()</b>"); } while ($row = mysqli_fetch_array($result)){ $id=$row[id]; $first=$row[first]; $last=$row[last]; $e_mail=$row[e_mail]; $phone=$row[phone]; $b_date=$row[b_date]; $address=$row[address]; $town=$row[town]; $stco=$row[stco]; $postcode=$row[postcode]; $country=$row[country]; echo "<TABLE WIDTH=100% HEIGHT=30 Border=5 Border color='#616161'>"; echo "<TR><TD>$id</TD></TR>"; echo "<TR><TD>$first</TD></TR>"; echo "<TR><TD>$last</TD></TR>"; echo "<TR><TD>$e_mail</TD></TR>"; echo "<TR><TD>$phone</TD></TR>"; echo "<TR><TD>$b_date</TD></TR>"; echo "<TR><TD>$address</TD></TR>"; echo "<TR><TD>$town</TD></TR>"; echo "<TR><TD>$stco</TD></TR>"; echo "<TR><TD>$postcode</TD></TR>"; echo "<TR><TD>$country</TD></TR>"; echo "</Table>"; } <b>If I lay it out like this all individual attributes fall top to bottom within a table. It looks neat enough but takes up alot of room, wastes space and as I said my "desciptions" are written across the top. Thanks to any info I can get Links are always welcome I have searched but cant seem to get the wording right I guess. Happy New Year and cheers!</b> |
|||
|
#2
|
|||
|
|||
|
Thanks for thoughts
I did fix it. it was a matter of rearranging the <TR>and<TD> tags. I guess I need to brush up on the HTML. It seems to be the easiest way. echo "<TABLE WIDTH=100% HEIGHT=10 Border=2 Border color='#616161'><TR>"; echo "<TD colspan=15><Font color='#000000'>$id</Font></TD>"; echo "<TD colspan=40><Font color='#000000'>$first</Font></TD>"; echo "<TD colspan=40><Font color='#000000'>$last</Font></TD>"; echo "<TD colspan=60><Font color='#000000'>$e_mail</Font></TD>"; echo "<TD colspan=40><Font color='#000000'>$phone</Font></TD>"; echo "<TD colspan=30><Font color='#000000'>$b_date</Font></TD>"; echo "<TD colspan=50><Font color='#000000'>$address</Font></TD>"; echo "<TD colspan=40><Font color='#000000'>$town</Font></TD>"; echo "<TD colspan=40><Font color='#000000'>$stco</Font></TD>"; echo "<TD colspan=30><Font color='#000000'>$postcode</Font></TD>"; echo "<TD colspan=30><Font color='#000000'>$country</Font></TD>"; echo "</TR></TABLE>"; Happy NEW YEAR and cheers. |
|
#3
|
||||
|
||||
|
Sorry I missed your post Zurke. I'll try not to let it happen again
Anyway, you came back to post the solution; which I appreciate a lot. Thank you. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 14:12 |
| Using getline to read in data | krisbot | C Programming Language | 4 | 24-Oct-2004 16:57 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
| Automate a data change php form | mjfmn | MySQL / PHP Forum | 4 | 20-Oct-2003 10:37 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The