GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 31-Dec-2004, 11:56
Zurke Zurke is offline
New Member
 
Join Date: Dec 2004
Posts: 12
Zurke is on a distinguished road

Organizing selected data


Hi,
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  
Old 31-Dec-2004, 19:28
Zurke Zurke is offline
New Member
 
Join Date: Dec 2004
Posts: 12
Zurke is on a distinguished road
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  
Old 04-Jan-2005, 10:46
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
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.
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 15:56.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.