0

hi guys..
pls help me out..

in my project , i am extracting the data from mysql database..
and presenting it in a table..

each time a new data is getting displayed row wise..dynamically..
how can i make that data to be get displayed column wise..

fr eg : i m getting it like .. item 1
item 2
item 3
.
item n
but i want it to be ... item 1 item 1 item 2 ... item n

Edited by rohit b k: n/a

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by showman13
0

put your array data into a <table> <tr> instead of <table> <td> . then it display in a column.

Edited by Kadafiz: n/a

0

put your array data into a <table> <tr> instead of <table> <td> . then it display in a column.

After you have done your select query, if it is multiple records with a single field you are returning, you can use a while loop to display the data retrieved, putting each piece of data into a <td> data </td>

example:

<table width="500">
  <tr>

<?php
while($return=mysql_fetch_array($sql)){
$data=$return[0];
print "<td>".$data."</td>";
}

  </tr>
</table>

I think that should work... didn't test it though.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.