Update A Record With SQLite Part 2 - Python Tkinter GUI Tutorial #23

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024

Комментарии • 161

  • @Codemycom
    @Codemycom  4 года назад +3

    ▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My RUclips Channel:
    bit.ly/2UFLKgj bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
    Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN

  • @ajinkyasonwane4433
    @ajinkyasonwane4433 4 года назад +23

    Someone is sitting in the shade today because someone planted a tree a long time ago. Appreciate your efforts. This series has helped me a lot. Thanks a lot.

    • @Codemycom
      @Codemycom  4 года назад +2

      Glad you enjoy them!

  • @bhattvd1
    @bhattvd1 3 года назад +3

    Thanks, John. You are a great teacher!

    • @Codemycom
      @Codemycom  3 года назад

      thanks for watching!

  • @sulekhabaranwal178
    @sulekhabaranwal178 2 года назад +2

    he deserves so more he keeps on creating so good videos I hope you will touch stars one day coz you are awesome

    • @Codemycom
      @Codemycom  2 года назад +1

      Thanks, I appreciate it!

  • @itsomegali5342
    @itsomegali5342 4 года назад

    jhon keeps bumping his head into different things every week
    oh also thanks for the awesome content.(really without you i wouldn't have made my project)

  • @dsmdan83
    @dsmdan83 4 года назад +1

    Love the videos. Very easy to follow and understand. Thank you so much for providing these!! Quick question tho. I’m new to a bunch of this stuff. Is this a standalone program that needs to be stalled on a computer or would your program be ran inside a browser window? Also does this program as it sits, have the functionality to be opened in many different instances by multiple users and allow them to create, update and delete records from the GUI or limited to single user? Thanks for taking the time to provide this content and for reading my questions

  • @HugoCervantes-HARO
    @HugoCervantes-HARO 3 года назад

    Uppppssss! Hope you are not badly hurt John!!

  • @masekin
    @masekin 2 года назад

    Thank you for your efforts and clear explanations! :)

  • @MMMEHTA99
    @MMMEHTA99 11 месяцев назад

    Great job sir

  • @blumenzupfer4255
    @blumenzupfer4255 4 года назад

    awesome videoseries. the explanations are nice and clear. helped me a lot to do some own works and project. love your videos and the way how you teach :)

  • @Shaktiswaruppsingh
    @Shaktiswaruppsingh 5 лет назад

    Thank you sir it helps me a lot on my project...thank you so much

  • @mormoj4930
    @mormoj4930 2 года назад

    very usefull tutorial 👍

    • @Codemycom
      @Codemycom  2 года назад

      Glad you enjoyed it!

  • @leetimothy3244
    @leetimothy3244 2 года назад

    Thanks for your video. I learnt a lot for your videos. I have one question on this video. Why don't you use toplevel() to create the edit window instead of creating it just like root?

  • @mm333-e1t
    @mm333-e1t 5 лет назад +12

    Day 95: Still waiting for the next video in this project series. :D

    • @Codemycom
      @Codemycom  4 года назад +2

      lol there are 150 videos in this playlist...did you not know where to look?

    • @mm333-e1t
      @mm333-e1t 4 года назад +1

      @@Codemycom after this video u started a new project itself.. a whether app.

    • @Codemycom
      @Codemycom  4 года назад +4

      @@mm333-e1t Yeah and then 100 other videos.

    • @mm333-e1t
      @mm333-e1t 4 года назад +8

      @@Codemycom ya I thought ur next video would be a continuation of the same project... 😁 Because at d end of d video u had said that in the next video we will look at drop-down and stuff...

  • @ConcertLD
    @ConcertLD Год назад

    I might be getting a head of the lessons but would be nice to offset the new window when it opens instead covering the current window?

  • @parsabahrambeik4381
    @parsabahrambeik4381 4 года назад

    Hi, thank you very much for your video.

  • @AliFGT
    @AliFGT 3 года назад +1

    hi!
    in 11:51 i have an syntax error
    'oid' : record_id
    Syntax Error = no such column: addresses
    i copied your code in github and same syntax error
    plz replay i need help to that

    • @Codemycom
      @Codemycom  3 года назад +1

      I don't suggest copying code, errors like this occur

  • @habib-urrehman3094
    @habib-urrehman3094 5 лет назад +1

    Very good .. when you are doing other Video on this you mention on the end

  • @azmanbokir4186
    @azmanbokir4186 3 года назад +4

    Exception in Tkinter callback
    Traceback (most recent call last):
    File "C:\Python\Python39\lib\tkinter\__init__.py", line 1885, in __call__
    return self.func(*args)
    File "C:\Users\azmin\latihan pbd\databasepasien.py", line 40, in update
    c.execute("""UPDATE addresses SET
    sqlite3.OperationalError: no such column: tanggal_lahir
    sir please clarify I getting tied

  • @ClaytonMcKinley
    @ClaytonMcKinley 2 года назад

    Hey John thank you very much for your videos. Is there concern with sql injection when we put SET first_name = :first WHERE oid = :oid - Should we instead be using a place holder like =? Or is this not a concern with certain projects that may not be on the internet? Thanks again for your insight

  • @XxCadrosxX
    @XxCadrosxX 5 лет назад +4

    Hey @Codemy.com I keep getting an error that says the following.
    'oid': record_id
    sqlite3.OperationalError: near "text": syntax error
    Any help would be appreciated. Thanks!

    • @Corcontv
      @Corcontv 4 года назад

      its a syntax error, most likely you need a space after the : and before the record_id

  • @guitarec4105
    @guitarec4105 4 года назад

    5:15 , in mycase the primary key to be compared is a varchar type, how would i compare it
    c.execute("SELECT * FROM matchs where match_id="+ to_update_match_id
    )
    varchar type content is written in to_update_match_id

    • @Codemycom
      @Codemycom  4 года назад +1

      A primary key can't be a varchar...a primary key is definitionally a number, an integer

    • @guitarec4105
      @guitarec4105 4 года назад

      Thanks, the course was a great help!

    • @Codemycom
      @Codemycom  4 года назад +1

      @@guitarec4105 Glad you found it useful!

  • @modelrailwaytheeasyway9743
    @modelrailwaytheeasyway9743 4 года назад +1

    Enjoyed this project would love to see a scroll bar on the list etc. Any chance of any further projects with sqlite3?

    • @Codemycom
      @Codemycom  4 года назад +2

      Might do more sqlite...think I did a scollbar already

    • @modelrailwaytheeasyway9743
      @modelrailwaytheeasyway9743 4 года назад +1

      Codemy.com I did watch a video you did on scroll bars just not sure how to go about it on this as the label box only shows up once button is clicked also trying to sort out the strange text overlay when refreshed. I wonder if setting the label to show always less the text would work? I will be doing a lot of learning on your website as I think I am trying to run before I can walk. Who says you can’t teach an old dog new tricks.

  • @Corcontv
    @Corcontv 4 года назад +1

    is there a way to search the database for a string or collection of strings?
    EDIT: found a way to search using LIKE but its only pulling one record even with fetchall() and fetchmany() and it also has to match the entry in that column exactly, so if i have a name and want to search for it partially
    EDIT 2: so this is where im at (made it easier to read)
    cursor.execute("
    SELECT *, oid
    FROM customer
    WHERE f_name
    IN Customer
    LIKE :name", ('name': (f_name.get(),)))
    basically what im trying to do is make a button for looking up names in the database and displaying them to a label

  • @slickwillie3376
    @slickwillie3376 4 года назад

    You are quite clever. This program is awesome and I learned a lot. Thx. ◉‿◉

    • @Codemycom
      @Codemycom  4 года назад

      Thanks Slick Willie!

  • @Acuce7ibd468j
    @Acuce7ibd468j 4 года назад

    i like the videos u make .thank u

    • @Codemycom
      @Codemycom  4 года назад +1

      Thanks for watching!

    • @Acuce7ibd468j
      @Acuce7ibd468j 4 года назад

      @@Codemycom really i follow u from lebanon . And all my friends in my uni watch ur vids and get benifit alot from ur experience. ❤👍

    • @Codemycom
      @Codemycom  4 года назад

      @@Acuce7ibd468j Awesome!

  • @stylian76
    @stylian76 2 года назад

    Is there anywhere we can find the code of the whole program?
    Thank you and great work you are helping us a lot!

    • @Codemycom
      @Codemycom  2 года назад +1

      GitHub.com/flatplanet

  • @filipk2834
    @filipk2834 4 года назад +1

    When you do editing buttons you have to use classes, if you don't do that you will have problems with editing clients e.g. with the same name, because the variable x is still overwritten

    • @filipk2834
      @filipk2834 4 года назад

      Something like that
      class Button12:
      def __init__(self, id2, index, x):
      self.id2 = id2
      self.index=index
      self.x=x
      def cbutton(self):
      num=0
      edit_button = Button(ramka, text="Edit "+str(x[4]),command=lambda: edit_now(self.index, self.id2))
      edit_button.grid(row=self.index, column=num)
      for y in x:
      searched_label = Label(ramka, text=y)
      searched_label.grid(row=self.index, column=num+1)
      num += 1

      if not result:
      result = "Record not found..."
      else:
      print(result)
      id_reference=[]
      for index, x in enumerate(result):
      id2=str(x[4])
      p1 = Button12(id2, index, x)
      p1.cbutton()

    • @Codemycom
      @Codemycom  4 года назад +1

      Not true. There are always infinite ways to do anything. If you like classes, use them. But you certainly don't have to.

    • @filipk2834
      @filipk2834 4 года назад

      Open your version of this application and try to edit the first person on the list when there are at least 2 people on the list. An error will occur and the data of person 2 will be displayed for person 1

    • @filipk2834
      @filipk2834 4 года назад

      I was able to fix it only by using a class, but maybe there are other ways

    • @Codemycom
      @Codemycom  4 года назад

      @@filipk2834 worked fine

  • @rutulsojitra5703
    @rutulsojitra5703 3 года назад +1

    Sir , what kind of jobs we can get after full learning of database with python

    • @Codemycom
      @Codemycom  3 года назад

      You can get jobs programming databases with python :-p

  • @klauspesendorfer3890
    @klauspesendorfer3890 2 года назад

    Hallo John, this SQLite Part of this trainig was very helpful for me. I've created a project-Database but when I click the save Button in the edit Window, the changes havn't be done. Do you have an idea whats wrong? I dind't get an error massage, so its hard to find the missmatch. Thanks, klaus

    • @Codemycom
      @Codemycom  2 года назад +1

      Look to the section of your code that saves to the database, you likely left out something

  • @marcotulios8
    @marcotulios8 5 лет назад

    AMAZING

  • @danielmayper6548
    @danielmayper6548 4 года назад

    Hey man these tutorials are really proving a valuable asset in learning this material but I noticed that there isn’t a tutorial which has the other stuff that you were talking about at the end of the video, is there a video with those topics on codemy.com?

    • @Codemycom
      @Codemycom  4 года назад

      what other stuff was that? (I recorded this video like a year ago, don't remember what you're referring to)

    • @danielmayper6548
      @danielmayper6548 4 года назад

      @@Codemycom drop down box with records, what to do if you try and edit a record that doesn't exist, maybe edit record indicies?

    • @Codemycom
      @Codemycom  4 года назад

      @@danielmayper6548 How could that happen? If the record doesn't exist, how could it be in the drop down box?

    • @danielmayper6548
      @danielmayper6548 4 года назад

      @@Codemycom I think that was the point of it: it can't. I figured the purposed would've been to trigger some kind of error saying "Hey this doesn't exist, please enter a valid UID" or something

    • @Codemycom
      @Codemycom  4 года назад

      @@danielmayper6548 Nah, if a record doesn't exist, it couldn't be populated in a drop down box that pulls records from the database.

  • @daggercentral9818
    @daggercentral9818 3 года назад

    I modified your code sir, Instead of opening the records in show records in the label, I opened them in notepad.

  • @CHAITANYAKARTHICK
    @CHAITANYAKARTHICK 4 года назад

    will u plz tell me how many classes and how function are there in tkinter module?

    • @Codemycom
      @Codemycom  4 года назад

      Sorry, I have no idea what you're asking...

    • @sivasurya4149
      @sivasurya4149 4 года назад

      How many module are there in tkinter....

  • @pheebs8571
    @pheebs8571 5 лет назад

    hello . Is this the end of the program ? I kinda need to finish one of those for a school project and your tutorial is great for me . but I can tell its not finised .

    • @Codemycom
      @Codemycom  5 лет назад

      I'll probably add more to it, or continue on with more tkinter tutorials. Super busy with another project at the moment though...

  • @erzio1254
    @erzio1254 5 лет назад +1

    Hello sir, please hear my comment.
    What could be this error im getting..
    File "C:\gui\database.py", line 37, in update
    c.execute("""UPDATE addresses SET
    sqlite3.OperationalError: no such column: mobile
    I changed the zipcode to mobile and rechecked all the operation that caused it but i cant find it.
    Any help will do.

    • @Codemycom
      @Codemycom  5 лет назад

      it's telling you that you didn't actually change the column name to mobile like you think you did

    • @erzio1254
      @erzio1254 5 лет назад

      @@Codemycom I try changing it all to zipcode and it finally works haha. BTW, thanks for this video, now i have a project.

    • @Codemycom
      @Codemycom  5 лет назад +1

      @@erzio1254 awesome

  • @mikewyatt8058
    @mikewyatt8058 3 года назад

    Which is the next tutorial in this series (ie the SQL Addresses Database) - No 24 starts off on a different topic

  • @HimanshuBansal-eu5dw
    @HimanshuBansal-eu5dw 2 года назад

    I am getting the error while updating the record (sqlite3.OperationalError: near ".": syntax error). What might be the issue?

    • @Codemycom
      @Codemycom  2 года назад

      The error is telling you what the issue is.

  • @ironunityg6443
    @ironunityg6443 2 года назад

    is there any video to see how to make the game automatically update the score of a player if a game ends if the score is bigger?

  • @EditHubHQ
    @EditHubHQ 5 лет назад

    I dont know what mistake have i done in my code but the changes made in the entry box is not updated.....Can u plzz help me???

    • @DynamicCoding
      @DynamicCoding 5 лет назад

      My entry box is also not update and I gives error on 'oid ': record _id

    • @danielmayper6548
      @danielmayper6548 4 года назад

      @Yogi pedia it looks like you have a space in your code between the d and the ‘, maybe using ‘oid’: record_id will help over ‘oid ‘: record_id

  • @AnujKumar-xn5tg
    @AnujKumar-xn5tg 4 года назад

    SIR , at what age you started coding?

    • @Codemycom
      @Codemycom  4 года назад +1

      I was 8 years old when I started

    • @AnujKumar-xn5tg
      @AnujKumar-xn5tg 4 года назад

      @@Codemycom sir people say that C++,Java is better than python
      But i really like python

    • @Codemycom
      @Codemycom  4 года назад +1

      @@AnujKumar-xn5tg Me too...Java is a nightmare

  • @mohamadmatinhavaei9859
    @mohamadmatinhavaei9859 2 года назад

    Hello how can I fix this error ?: sqlite3.OperationalError: no such column: f_name

    • @Codemycom
      @Codemycom  2 года назад

      add a column named f_name to your model

  • @DP-xz7cc
    @DP-xz7cc 4 года назад

    Hey guys. I also included a bug in my code. I am executing the code with Spyder. When hitting the save button i have the following error message: 'oid' record_id sqlite3.Warning: You can only execute one statement at a time. Do you have any suggestions how to fix it? So in fact, when i hitthe save button in the new window nothing happens - it neither updates the record, nor does it destroy the window. Appreciating any advice :-)

    • @DP-xz7cc
      @DP-xz7cc 4 года назад

      I replaced c.execute with c.executescript to pass more then one statement and now got the following error: typeerror function takes exactly 1 argument (2 given). Is it a typo or was there some sqlite3 update?

    • @Codemycom
      @Codemycom  4 года назад

      you have an error somewhere

    • @DP-xz7cc
      @DP-xz7cc 4 года назад +1

      @@Codemycom Thanks mate! Got it now. It was only an indentation error. Suggesting all the python beginners to check for possible indentation errors iteratively. Sublime editor helps to figure out the indentation errors visually. Using spyder i fixed it with a built-in fix for indentation errors. Unfortunately, the error message in the console was misleading.

  • @pheebs8571
    @pheebs8571 5 лет назад

    hey . sorry to bother you . but I need some help with something. an I said in a previews comment your tutorial is great for what I need . its perfect actually. but I need to add one more thing. I have to create a DB for employees of a firm . and I need to add a button who will reduce every employee's salary with 5% . I have no idea how to do that, but I do know its simple . I just cant figure it out. can you help me with that ?

    • @Codemycom
      @Codemycom  5 лет назад

      Just do it in the exact same way as the videos but subtract 5% from the salary output... salary - (salary * .05)

    • @pheebs8571
      @pheebs8571 5 лет назад

      @@Codemycom ok . I found how . But I get an error .
      TypeError : cant multiply sequence by non-int of type 'float'. I cant figure it out .
      And it doesnt work if I make that sequence an int .

    • @Codemycom
      @Codemycom  5 лет назад

      @@pheebs8571 the salary is coming out of the database as an integer, to multiple by a decimal number (.05) you need to convert it to a float...wrap the salary in a float() function... like float(salary) - (float(salary)*.05)

    • @pheebs8571
      @pheebs8571 5 лет назад

      @@Codemycom yep. That worked . Thanks for your time . And good luck in what you do

    • @Codemycom
      @Codemycom  5 лет назад +1

      @@pheebs8571 sure thing!

  • @lockespc
    @lockespc Год назад

    Is there a way to link this to a signin page

    • @Codemycom
      @Codemycom  Год назад

      what do you mean a signin page?

    • @lockespc
      @lockespc Год назад

      @@Codemycom so i am trying to build a CRM and i people able to have a account and be able to log into it but im not sure how to link a entry bar with the database to look for a certain username or password

    • @Codemycom
      @Codemycom  Год назад

      @@lockespc ​ @pixelmasters I have tons of videos on using databases with tkinter.

  • @hibasmi7997
    @hibasmi7997 3 года назад

    your videos are great but i keep getting this error even thought i wrote the code correctly :
    c.execute("""UPDATE addresses SET
    sqlite3.OperationalError: no such column: address
    i dont know what to do

    • @Codemycom
      @Codemycom  3 года назад

      It's telling you there is no column called address, you likely forgot to create a column or named it something slightly different.

    • @hibasmi7997
      @hibasmi7997 3 года назад +1

      @@Codemycom i understand but the problem is that i am following along with your video and I wrote the code the same as you but I really don't know what to do

    • @Codemycom
      @Codemycom  3 года назад

      @@hibasmi7997 No, you didn't write the code the same as me. You have a typo or forgot to create the column.

  • @hartfamilyhome
    @hartfamilyhome 4 года назад

    I get and error that says
    File "C:/Users/colin/PycharmProjects/hello_world/venv/Data Bace App with Tkinter.py", line 203, in update
    c.execute("""UPDATE adresses SET
    sqlite3.InterfaceError: Error binding parameter :new - probably unsupported type.
    any help would be appreciated

    • @Codemycom
      @Codemycom  4 года назад +1

      Pycharm sucks...I can't help you with that. Try using the tools I do.

  • @tejasgorivale425
    @tejasgorivale425 4 года назад

    i'm getting an error i did many other ways but still getting errors in update section will you please help me with it

    • @Codemycom
      @Codemycom  4 года назад

      What's the error? Did you google the exact error? (copy and paste it right into google)

  • @mistermayhem988
    @mistermayhem988 4 года назад

    some of the data doesn't update?
    help?

    • @Codemycom
      @Codemycom  4 года назад

      check your code for typos

  • @MMMEHTA99
    @MMMEHTA99 11 месяцев назад

    SIR I DONE THIS BUT ERROR "sqlite3.ProgrammingError: You can only execute one statement at a time." I CAN'T FIND IT
    PLZ MAKE SOLUTION

    • @Codemycom
      @Codemycom  11 месяцев назад +1

      Check your code to discover what you did differently from the video, that is the only solution.

    • @MMMEHTA99
      @MMMEHTA99 11 месяцев назад

      ok@@Codemycom

  • @gavinlightfoot2458
    @gavinlightfoot2458 4 года назад

    Anyone have the code to add a search field.

  • @AnujKumar-xn5tg
    @AnujKumar-xn5tg 4 года назад

    But ,Sir how these stuff can form a website ??

    • @AnujKumar-xn5tg
      @AnujKumar-xn5tg 4 года назад +1

      Sorry i mistakenly commented here
      I am talking about the CRM one

    • @Codemycom
      @Codemycom  4 года назад

      you can’t. tkinter is not a website tool

    • @AnujKumar-xn5tg
      @AnujKumar-xn5tg 4 года назад +1

      @@Codemycom Sir, your codemy.com site is made by using coding .PYTHON??

  • @borgyoh
    @borgyoh 5 лет назад

    i keep getting a unrecognized token error ":"
    'oid' :record_id

    • @Codemycom
      @Codemycom  5 лет назад +1

      likely a typo in your code...can't tell without seeing it.

    • @borgyoh
      @borgyoh 5 лет назад +1

      @@Codemycom thats basicly it,
      'oid' : record_id
      therr is no other error, if i delete it then it just goes up a line and gives the same error for
      'zipcode' : zipcode_editor.get(),

    • @Codemycom
      @Codemycom  5 лет назад +1

      @@borgyoh Yeah, the whole block of code has an error in it somewhere. Somewhere in the c.execute("""UPDATE addresses SET... block...likely in the WHERE clause section you used a wrong quotation mark or something. Or you left out a comma somewhere..or something. Plus where is the colon ('oid': record_id) your first comment had it like this 'oid' :record_id (next to record_id which is wrong).

    • @borgyoh
      @borgyoh 5 лет назад +2

      @@Codemycom AAAAAAHHH!!! i found the problem, fixed it, yeah it was a typo... i went over it again and again...never noticed it. why cant we get away with bad grammar in coding? anyways, thanks for your tutorials and thanks for replying. i will try not to bother you until i make ultra sure what the error is. maybe i need to buy glassess

    • @Codemycom
      @Codemycom  5 лет назад +2

      @@borgyoh no worries...it's always hard to catch typos...our brains just pass over them. Sometimes I have to leave the code for a day or two and then look at it again before the typo jumps out and I notice it lol

  • @vanshatcode
    @vanshatcode 4 года назад

    why did to write (WHERE oid = :oid)

    • @Codemycom
      @Codemycom  4 года назад

      huh?

    • @vanshatcode
      @vanshatcode 4 года назад

      In video 22 of tkinter.
      I am unable to understand the following.
      WHERE oid = :oid

  • @dylanyadav7839
    @dylanyadav7839 4 года назад +2

    Aye yo..someone do me a solid and put the whole code in comments for me to copy and paste

    • @ricky5870
      @ricky5870 4 года назад

      yes please someone come in clutch

    • @Codemycom
      @Codemycom  4 года назад +1

      @@ricky5870 Don't be lazy, write the code yourself or you won't learn it.
      github.com/flatplanet/Intro-To-TKinter-RUclips-Course

    • @ricky5870
      @ricky5870 4 года назад +1

      Codemy.com will do boss, replying to me have me motivation 👍

    • @Codemycom
      @Codemycom  4 года назад

      @@ricky5870 ha good

  • @anhuman7022
    @anhuman7022 3 года назад

    Where is the source code?

    • @Codemycom
      @Codemycom  3 года назад +1

      github.com/flatplanet

  • @sivasurya4149
    @sivasurya4149 4 года назад +1

    ERROR =Operation Error: no such column: frist_name.. sir please clarify... I getting tied

    • @Codemycom
      @Codemycom  4 года назад +1

      Check your code for errors