run arrays with html code


#1

i have simple questions but i dont found answers before.
i have 1 table with row.
i want that this table will be shown again any time the database have any result.
i mean that the function do while will print not only the array for example $result[‘names’];
i want the the code not print
name1
name2 …
but

..... name1
..... name2

like: do while function but i need to print a table too with the array.
can somebody give me help and give me the full code how to do this?
thanks!


#2

[php]<?php
$custid = $_GET[‘whatever…’];

$query = “SELECT * from //table name// where //whatever conditions are//”;
$result = mysql_query($query);

$row=mysql_fetch_array($result, MYSQL_ASSOC);

$name = $row[‘name’];
$address = $row[‘address’];
$whatever = $row[‘whatever’];

//etc., etc.

Then you can display as follows. If you want a different table every time, simply put the table html
where the tr and td html are, etc. below

echo "<table>$name<</table>\n";

echo "<table>$address</table>\n";

echo "<table>$whatever</table>\n";

?>

[/php]

Hope this helps.