🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rocksolid.nodes
Article #366

Re: sqllite, huh ?

#366
From: Retro Guy
Date: Wed, 16 Dec 2020 23:14
24 lines
1837 bytes
On Wed, 16 Dec 2020 04:44:57 -0800
Anonymous <poster@anon.com> wrote:

> >>805247d43ca8bf30d0
> > the only real thing you'd notice that shows it uses a db is that
> > the instructions tell you phpX.x-sqlite3 is required. You don't
> > need to take any action beyond installing that package.
> 
> How do you control the sql statements ? Are they all fully predefined
> or are you taking parameters from GET or POST ?

The sql statements use variables (after they're sanitized). They can be
from POST, but never used directly in the statements.

It's the same in vichan, that's where you see statements like:

$query = prepare("INSERT INTO ``search_queries`` VALUES
(:ip, :time, :query)");

Then the variables are inserted into the placeholders with bindvalue.
data should be sanitized for use using this step.

Both vichan and rslight use PDO so the statements look very similar.
Only that vichan uses mysql and rslight uses sqlite.
Technical Details
Message-ID: <20201216161452.5f1fb78a@desktop14.dt>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!rocksolid2!.POSTED.localhost!not-for-mail
References: <20201211185438.0facd5ad@desktop14.dt> <n.1270.3ui7zt@anon.com>

Show Full Headers
Complete Article Headers
Message-ID: <20201216161452.5f1fb78a@desktop14.dt>
Subject: Re: sqllite, huh ?
Date: Wed, 16 Dec 2020 16:14:52 -0700
From: Retro Guy <retro_guy@retrobbs.rocksolidbbs.com>
References: <20201211185438.0facd5ad@desktop14.dt> <n.1270.3ui7zt@anon.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!rocksolid2!.POSTED.localhost!not-for-mail
Newsgroups: rocksolid.nodes
Organization: RetroBBS
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: novabbs.org; posting-account="retrobbs1"; posting-host="localhost:127.0.0.1";
 logging-data="10175"; mail-complaints-to="usenet@novabbs.org"
X-Newsreader: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu)