Jump to content


This topic is now archived and is closed to further replies.


More Help needed.

Recommended Posts

Sorry for being such a noob at this.  But here is my issue.

I have a page that displays data coming out of a table that places the data in row format.  I would like to have it displayed in column format.  I don't want the data to be editable though.

Here is the code that spits it out in Row format:
[code]<table border="0" cellpadding="5" cellspacing="0" align="center" style="font-size: 9pt; border: solid 1px">

    <tr bgcolor="#b5d0e5">
<th align="center">Sierra Name</th>
<th align="center">Location</th>
<th align="center">Date Joined</th>
<th align="center">Status</th>
    <th align="center">Open</th>
<th align="center">Member Bio</th>
$sql = "SELECT * FROM users WHERE username = '$username'";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result))
    <tr style="color: #111111">
<td align="center"> <?echo $row["sierra"];?> </td>
<td align="center"><?echo $row["location"];?></td>
<td align="center"><?echo $row["signup_date"];?></td>
<td align="center"><?echo $row["status"];?></td>
    <td align="center"><?echo $row[""];?></td>
<td align="center"><?echo $row["bio"];?></td>

That spits the data out like this:

Sierra          Location          Signup Date          Status        Open          Bio
Data            Data                Data                  Data          Data          Data

[b]I like to have it displayed as this:[/b]

Sierra: data
Location:  data
Signup Date: data
Status:  data
Open: Data
Bio: data (but the data needs to be in a scrollable text box)

I have tried this and modified it many times and still nothing appears:

[code]<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="17%" id="AutoNumber1">
      <td width="99%" align="center">Sierra Name</td>
      <td width="3%"><?echo $row["sierra"];?></td>
      <td width="99%" align="center">Location</td>
      <td width="3%"><?echo $row["location"];?></td>
      <td width="99%" align="center">Date Joined</td>
      <td width="3%"><?echo $row["signup_date"];?></td>
      <td width="99%" align="center">Status</td>
      <td width="3%"><?echo $row["status"];?></td>
      <td width="99%" align="center">&nbsp;</td>
      <td width="3%">&nbsp;</td>
      <td width="99%" align="center">Member's Bio</td>
      <td width="3%"><?echo $row["bio"];?></td>

[color=blue][b]Thanks very much in advance[/b][/color] :(

Share this post

Link to post
Share on other sites
Try exactly that but replace [b]<?echo[/b] $row... with [b]<?php echo[/b] $row...

Share this post

Link to post
Share on other sites
incase it works why?

this is how to start a php code without shortcut
this how to start php code with short cut.
to use the php shortcut method you need to set it in the php.ini
but it is good code pratice to use the first example.

Share this post

Link to post
Share on other sites
AndyB - Thanks very much for the help.  Worked great

redarrow - Didn't know that.  I will remember that.  The scripts I am running was written for me for other prior uses.

Share this post

Link to post
Share on other sites


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.