#🔒 My code somehow doesnt read the things in database

90 messages · Page 1 of 1 (latest)

summer cape
#

firstly my code wasnt reading the old books which are in script so i wanted to see if theres another problem then ı created a new book tried with it it said "no such column odunc_alan" so ı tried to add it with "kıtap_ekle" button then i tried to search that book with "kitap_ara" button it said there is 5 columns but you are searching 4 (not sure but something like that) can anyone help me?

heres the code:https://paste.pythondiscord.com/QR7A

night briarBOT
#

@summer cape

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

cold raft
#

Yeah it doesn't exist

#
CREATE TABLE IF NOT EXISTS kitaplar
 (ad TEXT PRIMARY KEY,
 yazar TEXT,
 tur TEXT,
 odunc_alindi_mi INTEGER)

There's no odunc_alan column. There is odunc_alindi_mi column

summer cape
#

ım back

summer cape
cold raft
summer cape
#

ı need that but when i add it with odunc_alan it gives an error

#

while i use the ki

cold raft
#

You could probably add a new column for it

summer cape
#

kitap_ara button

#

lemme show you the error

#

this is the error

#

!traceback

sick lance
#

what is your table structure?

summer cape
#

lemme show you

#

this is the structure

#

where is my mistake ?*

summer cape
sick lance
#

well there's your problem

#

as the error message says, your table has only 4 columns but you're trying to insert 5 values

summer cape
#

ım confused about thar

#

that

sick lance
#

CREATE TABLE IF NOT EXISTS — the "IF NOT EXISTS" part

odd swift
#

hmm

#

so what is it ment to do?

summer cape
#

the all code or this part ?

odd swift
#

the code

summer cape
odd swift
#

ok

sick lance
#

your table already exists, and has 4 columns.

sick lance
summer cape
sick lance
#

you deleted the .db file?

summer cape
#

yep

odd swift
summer cape
#

seems like its working

summer cape
#

can you fix that too ??

odd swift
#

function

#

ok

summer cape
#

you see the ödünç al button

#

?

#

that meant to borrow the book

odd swift
#

there is a error on line 31

summer cape
#

which code yours or mine ??

odd swift
#

mine

#

ill try yours

summer cape
odd swift
#

yours line 30

#

wait i think i see the problem with mine

summer cape
#

nevermind about that

#

there isnt any problem about the last code you sent

odd swift
#

oh

#

hmm

summer cape
#

the only problem "ödünç al" button cant see the book

#

it meant to borrow the book

#

book = kitap

odd swift
#

well i tried my best

#

wait

#

have you tried book = "kitap"

summer cape
summer cape
#

there isnt anything about book in there

#

kitap means book in turkish

odd swift
#

ödünç al

#

idk

summer cape
#

it meant to borrow the kitap but it cant see the book or recognize

odd swift
#

hmm well i dont know

#

sorry

summer cape
#

dam

odd swift
#

well i tried

summer cape
summer cape
odd swift
#

np

summer cape
#

at least you solved the first problem

odd swift
#

yeah

summer cape
#

!close

night briarBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.