need help to arrange the data correctly


#1

hi there…i try to display the data in a table…but it was messy…here i submit my coding…
[php]

Untitled Document

View E-Payment Status

<? include "db1.php"; $sql="select * from voucher "; $result=mysql_query($sql)or die(mysql_error()); while($r=mysql_fetch_assoc($result))// to make the data repeated { ?>
<?
}
?>
 <?

include “db1.php”;
$sql="select * from details ";
$result=mysql_query($sql)or die(mysql_error());
while($r=mysql_fetch_assoc($result))// to make the data repeated
{
?>






<?
}
?>
Transaction Id Purpose Requestor Sect Manager Unit manager FM FD ED
<? echo $r['t_id'];?> <? echo $r['purpose' ];?> <? echo $r['prepare_by'];?> <? echo $r['remarks' ];?> <? echo $r['remarks1'];?> <? echo $r['remarks2'];?> <? echo $r['remarks3'];?> <? echo $r['remarks4'];?>

 

[/php] please help...thanks in advanced

#2

What do you mean ‘it was messy’? Can you show us the page in action?


#3

actually it must display in the table…but it was displayed in one line…


#4

And can you show us an example? Like a link to the actual page?


#5

i done it in localhost and i dont have web host … how i upload it?


#6

Okay, have you tried copying your HTML and putting it through the validator?


#7

yes…the html is ok…just the while function…if not mistaken…i guess


#8

First of all, I’d seriously doubt XHTML 1.0 Transitional will allow you to omit table row closing tags, but I guess that’s not my problem.

As for sorting your results, you can use the ORDER BY clause in your SQL query, letting the MySQL database do the sorting for you.


#9

ok…
me result must be like this

data data data data data data

data data data data data data

data data data data data data

but the actual result i get is

data data

data data

data data data data data data data data