How about the way put a database of SQLite 3 beside web folder?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How about the way put a database of SQLite 3 beside web folder?

Apple-9
Hi
        I just connected SQLite 3 with PHP.
        The key point  could be My database should put in same fold where as info.php.
        And set
        extension = php_pdo.dll
        extension = php_pdo_sqlite.dll
        first.

        Know I have a question:
                if I can put the database of SQLite 3 beside the folder of web, and still can be accessed  via php
                Is there some way?

thanks!
       

[hidden email]

13989274151
skype: newmen512
qq:16929852



_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How about the way put a database of SQLite 3 beside web folder?

Simon Slavin-3

On 15 Dec 2011, at 7:52pm, Apple wrote:

> I just connected SQLite 3 with PHP.
> The key point  could be My database should put in same fold where as info.php.
> And set
> extension = php_pdo.dll
> extension = php_pdo_sqlite.dll
> first.
>
> Know I have a question:
> if I can put the database of SQLite 3 beside the folder of web, and still can be accessed  via php
> Is there some way?

The SQLite database file is accessed as a file by PHP.  It must be accessible (both location and protection) by your web server process as a local file.  In your 'open' command specify the full path to the database.

I would not advise putting it in a folder that you are serving to the web since this would allow anyone browsing yourweb site to inspect the full contents of the file.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How about the way put a database of SQLite 3 beside web folder?

romtek
On Fri, Dec 16, 2011 at 8:31 AM, Simon Slavin <[hidden email]> wrote:
> I would not advise putting it in a folder that you are serving to the web since this would allow anyone browsing yourweb site to inspect the full contents of the file.


One could easily configure the server to *not* serve database files
(or contents of folders) to a site's visitor. Therefore, it could be
located anywhere.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

insert error

inq1ltd

Can someone let me know why the following
keeps giving invalid syntax err msg.

 con = sqlite3.connect(sqldb)
 cursor = con.cursor()
 cursor.execute insert into default (rowname) values ( '1' ) ;
 con.commit()
 con.close()

I get invalid syntax pointing to the t in insert.

jimonlinux
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: insert error

Petite Abeille-2

On Dec 20, 2011, at 8:34 PM, jim-on-linux wrote:

> cursor.execute insert into default (rowname) values ( '1' ) ;

'default' is a keyword:

http://www.sqlite.org/lang_keywords.html

If you insist on that name, double quote it.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: insert error

Eric Pankoke
Besides that, shouldn't it be

cursor.execute "insert into ""default"" (rowname) values('1');"

I would expect that the execute command is expecting a string containing the SQL to execute.




----- Original Message -----
From: "Petite Abeille" <[hidden email]>
To: "General Discussion of SQLite Database" <[hidden email]>
Sent: Tuesday, December 20, 2011 2:40:50 PM
Subject: Re: [sqlite] insert error


On Dec 20, 2011, at 8:34 PM, jim-on-linux wrote:

> cursor.execute insert into default (rowname) values ( '1' ) ;

'default' is a keyword:

http://www.sqlite.org/lang_keywords.html 

If you insist on that name, double quote it.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users