php html5 mui 操作 sqlite 读取select,删除delete,统计count

  • Comments Off on php html5 mui 操作 sqlite 读取select,删除delete,统计count
  • A+

需要查看菜谱的源文件,有些字符显示不出来
php统计总数

SELECT COUNT(*) as count FROM product where product_online = 1;
$ret = $db->query($sql);
$row = $ret->fetchArray(SQLITE3_ASSOC);
$total_nums = $row ['count'];
//前后加EOF

php读取数据

SELECT * FROM product where product_online = 1 and product_id < 9999999 ORDER by product_id ASC;
//这个和mysql一样,只不过前后加EOF
html5 mui 操作 sqlite
plus.sqlite.openDatabase({name: 'gymenu',path: 'db.db'});
plus.sqlite.selectSql({
name: 'gymenu',
sql: 'select * from product where product_online=1 and category_id =' + cotegoryID,
success: function(e){
var rows = (JSON.stringify(e));
//console.log(rows);
rows = JSON.parse(rows);
var newCount = cells.length>0?4:rows.length;
for (var i = cells.length, len = i + newCount; i < len; i++) {
innerHTML = '<a href="#"><img class="mui-media-object" src="file:///storage/emulated/0/DCIM/gymenu/'+%20category_id%20+'/'%20+%20product_id%20+%20'.jpg" alt="php html5 mui 操作 sqlite 读取select,删除delete,统计count" alt="菜品" data-preview-src="" data-preview-group="1" /></a>'+ product_name + product_price + product_Pheromone +''; } }, fail:function(e){console.log(JSON.stringify(e));}});
plus.sqlite.closeDatabase({name: 'gymenu'});