~jorge/charms/precise/lamp/readme-fixes

« back to all changes in this revision

Viewing changes to website/databaseweb.php

  • Committer: Victor Palau
  • Date: 2012-09-04 18:31:25 UTC
  • Revision ID: vtuson@gmail.com-20120904183125-erhekfwi0ldadcyf
added option to set up a bzr branch for website installation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
include '../webconfig/opendb.php'; 
4
 
 
5
 
 
6
 
//run query
7
 
$query=mysql_query("SELECT * FROM mytodo WHERE todo_id > 0");
8
 
 
9
 
 
10
 
echo "<table border='1'>";
11
 
echo "<tr><th>Id</th><th>Todo</th><th>Is it starred</th></tr>";
12
 
 
13
 
while($result=mysql_fetch_assoc($query)) {
14
 
        $output[]=$result;
15
 
        echo "<tr><td>";
16
 
        echo $result['todo_id'];
17
 
        echo "</td><td>";
18
 
        echo $result['mytodo'];
19
 
        echo "</td><td>";
20
 
        echo $result['starred'];
21
 
        echo "</td></tr>"; 
22
 
 
23
 
}
24
 
echo "</table>"; 
25
 
 
26
 
mysql_close();
27
 
?>