我的php文件叫getuser.php 如下
$q = intval($_GET['q']);
class MyDB extends SQLite3{
function _construct(){
$this->open(‘CS1962.db’);
}
}
}
$db = new MyDB();
if(!$db){
echo $db->lastErrorMsg();
} else{
echo "Opened database successfully\n";
}
$sql =<<
SELECT * FROM MYTIME WHERE id = '".$q."'
EOF;
$ret = $db->query($sql);
echo "
TASK |
TAG |
DURATION |
DATE |
";
while($row = $ret->fetchArray(SQLITE3_ASSOC) ) {
echo "";
echo "" . $row['TASK'] . " | ";
echo "" . $row['TAG'] . " | ";
echo "" . $row['DURATION'] . " | ";
echo "" . $row['DATE'] . " | ";
echo "
";
}
echo "
";
$db->close();
?>