~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-03 16:48:29 UTC
  • Revision ID: vtuson@gmail.com-20120903164829-n5ob87ro845fzgzh
lamp charm

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
?>