Jump to content


Photo

More Help needed.


  • Please log in to reply
3 replies to this topic

#1 RSprinkel

RSprinkel
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 17 September 2006 - 12:31 PM

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:
<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>

That spits the data out like this:

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

I like to have it displayed as this:

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:

<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>

Thanks very much in advance :(
RSprinkel
A PHP/MySQL NOVICE I AM

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 17 September 2006 - 12:37 PM

Try exactly that but replace <?echo $row... with <?php echo $row...
Legend has it that reading the manual never killed anyone.
My site

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 September 2006 - 12:39 PM

incase it works why?

ansaw.
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.
<?
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 RSprinkel

RSprinkel
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 17 September 2006 - 01:29 PM

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.
RSprinkel
A PHP/MySQL NOVICE I AM




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users