This shows you the differences between two versions of the page.
kurs:functions.php [2014/09/10 21:22] |
kurs:functions.php [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | <?php | ||
+ | ini_set('display_errors', 1); | ||
+ | |||
+ | function dbconnect() { | ||
+ | $db = oci_connect('hr', 'hr', 'orcl'); | ||
+ | # . | ||
+ | # . | ||
+ | return $db; | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | function print_table($table) { | ||
+ | print "<table border=1>\n"; | ||
+ | foreach ($table as $row) { | ||
+ | print "<tr>"; | ||
+ | foreach ($row as $cell) { | ||
+ | if (!isset($cell)) {$cell = 'n/a'; } | ||
+ | print "<td> $cell </td> "; | ||
+ | } | ||
+ | print "</tr>\n"; | ||
+ | } | ||
+ | |||
+ | print "</table>\n"; | ||
+ | } | ||
+ | ?> | ||
+ | </code> |