My code below don't show me any name and address (only show <d> ) :
<html>
<body>
<H1>Testing</H1>
<table border="1">
<tr bgcolor="Blue">
<th>Name</th>
<th>Address</th>
</tr>
<?php
$db = array(
array("Binladen","los anger"),
array("Harry","NY"),
array("Ghost","lust caution")
);
/**
* return string
* params int $i
* return 'white' even and 'yellow' for odd numbers
* */
function rowColor($i)
{
$bgcolor1 = "white";
$bgcolor2 = "yellow";
if (($i%2) == 0)
{
return $bgcolor1;
}else {
return $bgcolor2;
}
}
function show()
{
global $db;
for($i=0,$n=count($db);$i < $n; $i++) {
$nv = $db[i] ;
$nv_name = $nv[0];
$nv_ad = $nv[1];
print " <tr bgcolor=\"".rowColor($i)."\">\n";
print " <td> $nv_name <\td> \n";
print " <td> $nv_ad <\td> \n";
print " </tr>\n";
}
}
show();
?>
</table>
</body>
</html>