Jump to content

More Help needed.


RSprinkel

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>
    </tr>
<?
$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>
    </tr>[/code]

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">
    <tr>
      <td width="99%" align="center">Sierra Name</td>
      <td width="3%"><?echo $row["sierra"];?></td>
    </tr>
    <tr>
      <td width="99%" align="center">Location</td>
      <td width="3%"><?echo $row["location"];?></td>
    </tr>
    <tr>
      <td width="99%" align="center">Date Joined</td>
      <td width="3%"><?echo $row["signup_date"];?></td>
    </tr>
    <tr>
      <td width="99%" align="center">Status</td>
      <td width="3%"><?echo $row["status"];?></td>
    </tr>
    <tr>
      <td width="99%" align="center">&nbsp;</td>
      <td width="3%">&nbsp;</td>
    </tr>
    <tr>
      <td width="99%" align="center">Member's Bio</td>
      <td width="3%"><?echo $row["bio"];?></td>
    </tr>
  </table>[/code]

[color=blue][b]Thanks very much in advance[/b][/color] :(
Link to comment
https://forums.phpfreaks.com/topic/21054-more-help-needed/
Share on other sites

incase it works why?

ansaw.
[code]
this is how to start a php code without shortcut
<?php
?>
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.
<?
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/21054-more-help-needed/#findComment-93454
Share on other sites

Archived

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

×
×
  • 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.