Location: PHPKode > projects > AccSoft > accsoft/lib/table_func.php
<?

include "database/mysql.php";
//echo "function<BR>";

function DB_Print_Table ($query) 
{
  $result=DB_Query($query);
  echo "<table cellpadding=1 cellspacing=1>";
  echo "<tr bgcolor=Black>";
  for ($i=0; $i < DB_Num_Fields($result) ; $i++) 
  {
    echo "<td>";
    $name=DB_Field_Name ($result,$i);
    echo "<b><font color=White>".$name."</font></b></td>";
  }
  echo "</tr>";
  while ($record=DB_Fetch_Array($result)) 
  {
    $table_name=DB_Field_table($result,0);
	//vypsani jedotlivych polozek
    echo "<tr>";
    for ($i=0;$i<(count($record)/2);$i++) 
    {
      echo "<td>";
      if ($anchor=="")  echo $record[$i];
      else
         if ($anchor==DB_Field_Name ($result,$i)) echo "<a href=".$table_name.".php?volba=edit&co=".$record[$i]."> ".$record[$i]." </a>";
         else echo $record[$i];
      echo "</td>";
    }
    echo "</tr>";
  }
  echo "</table>";

return 0;
}
?>
Return current item: AccSoft