comparison _xampp/contrib/sqlite.php @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b12c99b7c3f0
1 <html>
2 <head>
3 <title>PHP und SQLite</title>
4 </head>
5 <body>
6 <h1>PHP und SQLite</h1>
7 <table border="1">
8 <tr>
9 <th>Interpret</th>
10 <th>Titel</th>
11 <th>Jahr</th>
12 </tr>
13 <?php
14 $db = sqlite_open('../sqlite/cdcol', '0666');
15
16 $query = "SELECT * FROM cds";
17 $result = sqlite_query($db,$query);
18 if ($result)
19 {
20 while ($row = sqlite_fetch_array($result))
21 {
22 echo "<tr>";
23 echo "<td>".$row['interpret']."</td>";
24 echo "<td>".$row['titel']."</td>";
25 echo "<td>".$row['jahr']."</td>";
26 echo "</tr>";
27 }
28 }
29 else
30 {
31 echo sqlite_error_string(sqlite_last_error($db));
32 }
33
34 ?>
35 </table>
36 </body>
37 </html>