Sqlite php for beginners
Very important : tutorial for php sqlite. Not sql, not mysql, etcyou can't have a tutorial for sqlite without sql. that's like an eggless omelette: it doesn't exist!
94 Replies
the EXACT SAME base syntax works for sqlite and mysql
sql is just the "base" language where all others derive from
you can write most queries for mysql and sqlite, with 0 modifications
i think she was talking about OP xD

what is "php sqlite" ?
what's the diff between "php sqlite" and "sqlite"
Sqlite you are using dbbrowser, or terminal
Php sqlite you using website. You manage sql with php
Here is a few php sqlite :https://gist.github.com/bladeSk/6294d3266370868601a7d2e50285dbf5
Gist
SQLite3 PHP Quickstart Tutorial
SQLite3 PHP Quickstart Tutorial. GitHub Gist: instantly share code, notes, and snippets.
php sqlite is just an extension provided by php to interact with the sqlite DB?
so what's the diff between the usage?
what I'm understanding it's the same thing
sqlite and php sqlite
php sqlite is just the extension name which uses the same sqlite
Please open the link.
Is that same?
Which sqlite have variables?
$database
Did you see any sql with variables?
well I don't use sql or php that's why m asking lmao
i mean i did practice sql, but a year ago
don't quite Exactly remember everything
I understand, but you confusing everyone. And no one will answer
u r looking for video tutorials
Any. Text, video, anything is good
Video tutorials shows create database and that's it
if u just search php sqlite u get all that


the manual isn't enough?
Those are not . That is nothing. Create database and insert. And gone
How to update?
How to delete?
How to count?
aaah
discord
I did search . 1 week ago I am lookig and looking

i mean just search up
whenever u need something
if u don't find 1 compact guide then just Search individual operations
Problem is you not try those. Just drop me images.
Those are not working
I have to use variables. Not text.
If you create php file and copy , you realise error here error there
Not working
what issue r u facing rn with your project?
i believe u know how to connect
but i assume your issue is you don't know how to do CRUD operation??
Simple insert with variables. How to? With apostrophes or without?
Create read update delete
Crud
Yes I know
I know sql
I don't know sql in php
Why are you testing me?
Why I would like to lie?
calm down
I'm not testing you
I'm trying to understand the exact problem u have rn
i am not talking about sql
I'm asking if u know how to do these with php sqlite
cause if u know how to do CRUD with php sqlite, what issue do u have then?
not knowing how to use variables?
in which case search it up
https://stackoverflow.com/questions/19333792/how-to-use-php-variables-make-query-for-sqlite3
Stack Overflow
how to use php variables make query for sqlite3
<?php
/**
* Simple example of extending the SQLite3 class and changing the __construct
* parameters, then using the open method to initialize the DB.
*/
class MyDB extends SQLite3
{
funct...
u r asking for a tutorial but u said it yourself, u have been looking for tutorials but none suffices you
so if u can't find a compact solution for all your problems search individually
could you help me please how can I paste here php code?
aah
just copy paste in codeblock
```php
// your code
```
this is php sqlite create db , create table, insert data
but try it
m on mobile
inside you cannot found Dorothy
the insert data will be $nev
what does "nev" mean
if I take out apostrophy error message
"nev" is not a variable $nev is variable
ik but I'm asking the meaning
$nev sore "DOrothy"
look at the top of the code
php use variables what I have to give to sql
php code results store in variables
if someone write her name in insert box, and I would like to store, and phone number, or count something, and after she press the button to save datas, all those datas are in variables
sorry but may ik what the issue is with the code
u explained what it does or is supposed to do
what bug does this code have
so I have to give those variables value to the sql database
it doesn't create a column named dorothy?
I wrote to you : that code save into the database $name, not Dorothy
you might be doing some syntax error
in the place where u r inserting data
PHP does not do variable replacement inside single quoted strings
output
that is php only
not php sqlite
not the same
r u sure?
it really is the same
php does not do "CREATE TABLE" too
try that
that's the sqlite part
variable replacement is php part
but whatever, try what jochem said
Your code
not my code at all, you didn't replace the quotes just after the opening bracket
you can't have single quotes in a single quoted string, just as you can't have double quotes in a double quoted string
not without escaping them, at least
what if u do
"'$nav'"
that's not going to work, it's still in the original string
PHP strings are multiline
hmm ok
\ won't work here either?
it will, but you can also just switch the quotes from double to single
k
I am on it, please give me a minute
Fatal error: Uncaught Exception: near ")": syntax error in
did you change the end quote?
copy paste
you said I wrote wrong, so I copy paste it
did you change the CREATE TABLE part back too?
no. how should I have to?
i think u might wanna know more about the syntax as well
since u r having issues with quotes
yeah, I'd honestly recommend going through the base part of PHP's manual, it explains string syntax excellently
this is why I am looking a tutorial
I'm talking about php
this isn't a "php sqlite" issue, this is a very basic PHP issue
not php sqlite
you've got an extra comma at the end of
nev VARCHAR
Fatal error: Uncaught Exception: near "VALUES": syntax error in
I got extra, because I am doing fast, just write this quick
error in 14
you're missing a closing parenthesis after 'nev'
damn man u really need to fix these bugs yourself
I strongly recommend you take some time and learn the basics of the tools you're using
☝️
r u doing some sort of assignment? or school or college project?
no
only hobby
then why rush?
take it slow and learn slowly
1 week ago I try to do this. I am not rush.
I need a tutorial. To learn
u r in rush
u r facing issue with basic php bugs
u should practice that first
I wrote quick
and that's rush
and I have dislexy
I wrote this to you
to not wait
how long have u been practicing php?
you need to take a step back and learn more of the basics. You were asking for a PHP sqlite tutorial, but the issue you've presented here was simply a misunderstanding of the very basics of the way PHP handles strings. You don't have the background information necessary to identify what tutorials you need to follow, so you need to take a step back to the basics of the tools you're using
few years
really?
yes
i doubt but ok
I created a family tree site to my mom
ok
never mind
I am still looking some sql php tutorial
one week ago just waste time
.
@lanszelot please don't delete your questions when you're done with them. Others might still be able to learn from the answers people gave
i was thinking about this
I try to delete all, because it was not solved
Still might help someone, so please don't
I think it only confuse anyone
php sqlite tutorial not found anywhere
You never know what helps someone else. It's gone to leave it up
in this case sorry, I just try to do what I thought it is good
and what I thought I have to do