RSprinkel Posted September 17, 2006 Share Posted September 17, 2006 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 BioData Data Data Data Data Data[b]I like to have it displayed as this:[/b]Sierra: dataLocation: dataSignup Date: dataStatus: dataOpen: DataBio: 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"> </td> <td width="3%"> </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] :( Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 17, 2006 Share Posted September 17, 2006 Try exactly that but replace [b]<?echo[/b] $row... with [b]<?php echo[/b] $row... Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 17, 2006 Share Posted September 17, 2006 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.inibut it is good code pratice to use the first example.<??>[/code] Quote Link to comment Share on other sites More sharing options...
RSprinkel Posted September 17, 2006 Author Share Posted September 17, 2006 AndyB - Thanks very much for the help. Worked greatredarrow - Didn't know that. I will remember that. The scripts I am running was written for me for other prior uses. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.