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

« back to all changes in this revision

Viewing changes to website/database.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
//run query
 
6
$query=mysql_query("SELECT * FROM mytodo WHERE todo_id > 0");
 
7
while($result=mysql_fetch_assoc($query))
 
8
        $output[]=$result;
 
9
 
 
10
print(json_encode($output));
 
11
 
 
12
mysql_close();
 
13
?>