【问题标题】:PHP and Exists SQLITE [closed]PHP 和存在 SQLITE [关闭]
【发布时间】:2012-05-23 08:22:17
【问题描述】:

在PHP中插入数据、更新数据和删除表是否需要将现有的sqlite数据库复制到:memory:中?

表定义:

CREATE TABLE [appointment] (
    _appId integer NOT NULL PRIMARY KEY AUTOINCREMENT
   ,_id integer NOT NULL
   ,svc_id integer NOT NULL
   ,cust_id integer NOT NULL
   ,person_nm text NOT NULL
   ,cust_cno integer NOT NULL
   ,full_add text NOT NULL
   ,book_dt date NOT NULL
   ,app_dt date NOT NULL
   ,app_time time NOT NULL
   ,service text NOT NULL
   ,status text NOT NULL
   ,nxt_dt date
   ,nxt_time time
   ,att_dt date
   ,att_time time
   ,remark text
); 

和更新语句是:

UPDATE appointment 
SET svc_id='$sid',app_dt='$dt',app_time='$tim',full_add='$add',cust_cno='$cno' 
WHERE _appId='$i';

【问题讨论】:

  • 表定义:检查。更新声明:检查。问:呃……

标签: php sqlite pdo


【解决方案1】:

没有。您可以直接访问和更改存储在文件中的 SQLite 数据库。

【讨论】:

  • 非常感谢..但是我在更新表格时遇到了问题。它无法更新到数据库中。你能帮我吗...
  • @Yogi - 请包括您的表格定义和UPDATE 声明
  • @dezso-Table 定义:CREATE TABLE [约会] (_appId 整数 NOT NULL PRIMARY KEY AUTOINCREMENT,_id integer NOT NULL,svc_id integer NOT NULL,cust_id integer NOT NULL,person_nm text NOT NULL,cust_cno integer NOT NULL,full_add text NOT NULL,book_dt date NOT NULL,app_dt date NOT NULL,app_time time NOT NULL,service text NOT NULL,status text NOT NULL,nxt_dt date,nxt_time time,att_dt date,att_time time,remark text);并且更新语句是:UPDATE 约会 SET svc_id='$sid',app_dt='$dt',app_time='$tim',full_add='$add',cust_cno='$cno' where _appId='$i'。提前致谢。
  • @Yogi - 您的更新可以从 SQLite 控制台运行吗?你有任何错误吗?
  • 嗯...您对 db 文件有写权限吗?脚本可能没有它们。
猜你喜欢
  • 2016-02-24
  • 2012-05-22
  • 2010-09-07
  • 2015-04-27
  • 1970-01-01
  • 1970-01-01
  • 2012-05-07
  • 2013-02-06
  • 2014-05-07
相关资源
最近更新 更多