17 | Create Database Tables in MySQL PHP Tutorial | 2023 | Learn PHP Full Course for Beginners

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

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

  • @Dani_Krossing
    @Dani_Krossing  Год назад +67

    Hi everyone! Sorry about the long break 🙂 For people who check my community posts, you'll know that I have had to take care of Frida (my dog), who had been extremely sick for the past few weeks. Unfortunately she didn't make it, so I needed some time to deal with all that... But I'm back again now. 🙂

  • @ingelegenial
    @ingelegenial 10 месяцев назад +18

    You are underrated, Daniel. Thank you for everything.

  • @davescorneroftheworld1147
    @davescorneroftheworld1147 Год назад +14

    Very sorry for your loss. I am not a dog lover but I have lost a few cats in my 73 years so I understand your pain.
    THANK YOU FOR ALL YOU DO ON THIS TOPIC. I have learned so much from you.

    • @SamBoxEthiopia
      @SamBoxEthiopia 8 месяцев назад +7

      Learning php at 73??? You're my Hero.

    • @davescorneroftheworld1147
      @davescorneroftheworld1147 8 месяцев назад +1

      @@SamBoxEthiopia Thank you SanBox Ethiopis,
      I am NOT a Hero!
      I started out with electricity “talking to me”. Just into high school (in about 1966 or so) I decided I was to lazy to go across the room to turn my TV on and off. I made a WIRED remote control that would turn the TV on and off along with changing the volume. In 1966 NOBODY had ever heard of remote control on TV’s.
      After high school I went to an electronics school. In 1971 I was a certified electronics technician in the state of Missouri. I only did that for about three years of so.
      Then I went to work as a welder, with many welding jobs throughout my life. In about 1978 or 79 I started working at of the Pacific Northwest biggest saw mills.
      In 1983 I touched my FIRST computer. Make sure you get the date right. That was BEFORE Bill Gates was a household name. I have been addicted to them DAMN things every since.
      I welded in several jobs until about 2003 or so. Then I became a videographer, not long after that I got several jobs as a professional videographer. I retired in 2013 (or so I thought) I still have three to seven video shoots per year, I also help out friends out welding all the time.
      Soooo, now WHY NOT learn PHP. I am doing pretty well but I will probably never make any money with PHP. After all who wants to hire a 73 year old man. Besides that, I DO NOT WANT A FULL TIME JOB.
      So here I am setting in front of my two 27” monitors with a gaming system that is very very powerful. NO, I am not a gamer. But like I said I am addicted to computers.
      So I am not a hero by any means. Just someone that NEVER figured out what to do with my life. (:

  • @akashgola2153
    @akashgola2153 8 месяцев назад +4

    Sorry to hear about Frida. Hopefully ur over it now. The video was amazing as always. Also what i am liking the most is the logics or practicality inside ur videos. Great Work Keep going🔥

  • @shockearth4295
    @shockearth4295 26 дней назад +1

    Thank you! thank you! and thank you so much for this video series! I have a final project I have to do for my SQL class that requires me to use both PHP and SQL to build a database on whatever I want and I was confused how to do it. I am going to follow along your video series and customize my code based on your instructions. Without you I would have certainly failed this class because the whole semester I was basically copy and pasting everything from chatGPT and not really learning anything. But the way you describe it really makes me understand clearly. THANK YOU once again.

  • @Killer-ke6ff
    @Killer-ke6ff 6 месяцев назад +2

    Man you're a savior I have a web development course and you are saving me time and I actually understand you well Thanks for your efforts

  • @jaysau8723
    @jaysau8723 4 месяца назад +3

    This entire 40+ minutes video covers the entire unit of my uni course.

  • @theSassySquatch
    @theSassySquatch 6 месяцев назад +4

    Dani, you are awesome! You are a great teacher! Thank you for your videos!

  • @jackiedavis5574
    @jackiedavis5574 10 месяцев назад +2

    You are just the best!! Amazing delivery, simple logical explanation - you have freed me from my exasperation with my websites! Been looking for way to learn to do logins and comments on my site. (I hate those non-verbal, canned music, no explanation videos) but you are phenomenal! Forget binging tv shows, I am binging your tutorials!! Thank you so much! - and I am so sorry about your pup :(

  • @samnako
    @samnako Год назад +2

    I'm glad this video is out now when i am trying to design a new website and I will definitely pick one or two knowledge to add to what I'm doing right now.
    Thank you Daniel

  • @jd2722
    @jd2722 9 месяцев назад +4

    This is awesome, thank you!

  • @UHDking
    @UHDking Год назад +3

    Thanks for the freshest mySQL tut from the god of programming tuts(the best one was New Boston but he does not make any tuts anymore for a long time and this is a fresh vs his 2013). Love your tuts Dani and thanks for your time. You are the best on RUclips.

  • @decall
    @decall 7 месяцев назад +1

    I am so sorry to hear about your dog. We recently lost a cat and almost also our dog (but he went well fortunately). I love your lessons... Learned a lot of it...

  • @ArgieHista
    @ArgieHista Год назад +1

    Here I am again... Watching your videos and learning for something that no one can taught me easily but You... Thank you for sharing your knowledge.. Godblessed 🙏

  • @RolandTitan
    @RolandTitan 2 дня назад +1

    thank you sir

  • @renatusrichard
    @renatusrichard 8 месяцев назад +2

    Thank you so much sir, have enjoyed the lesson

  • @x6c3
    @x6c3 Год назад +2

    very help for a beginner ❤

  • @benjicanones1454
    @benjicanones1454 Год назад +2

    Superb!

  • @andymalunes8316
    @andymalunes8316 6 месяцев назад

    damn, many people just straight to this one, im new to programming and php but i noticed the views jump up for this specific lesson.

  • @JampolFugs
    @JampolFugs Месяц назад

    very helpful, thank you

  • @willschnack
    @willschnack Месяц назад

    Man. These videos have been super helpful so far. I am a subscriber now. I'm having trouble with a 1064 error, though. Syntax is exact, even had my wife look it over.

    • @willschnack
      @willschnack Месяц назад

      People on that forum are saying that this is not SQL at all, but MariaDB.

  • @nisanka
    @nisanka 5 месяцев назад +2

    Dani Krossing deserves 1 Million subscribers

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

    Very nice video. I was so into it

  • @bilalbeny4172
    @bilalbeny4172 10 месяцев назад

    thank you my brother 😍😍

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

    Thanks for the video

  • @armandoWebDev
    @armandoWebDev 6 месяцев назад

    Daniel, correct me if I'm wrong, but I read that VARCHAR has tha capability to take a VARIABLE amount of memory, so if we define (30) characters this doesn't mean that will reserve that space in memory, it is just the maximum amount of memory/characters can take in one spot but if you store let's say, 10 characters in a VARCHAR(30) will just consume 10 characters space in memory. Hope my idea is clear. Thank you for your course.!

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

    Thank you

  • @TOMAKAIROS
    @TOMAKAIROS Год назад +3

    im getting this error....
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIME,
    PRIMARY KEY (id)
    )' at line 6
    is my version too new??? or is it too old? how do i check the version?

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

      What is the full SQL that you tried to submit?

    • @TOMAKAIROS
      @TOMAKAIROS Год назад +1

      @@Dani_Krossing I’m not sure what you mean by that but I did everything that’s in the video.
      It seems it only works if I do CURRENT_TIMESTAMP instead of CURRENT_TIME.
      Is there a difference?

    • @hortensiamusic6670
      @hortensiamusic6670 9 месяцев назад

      ​@@Dani_Krossing I have the same problem: CREATE TABLE users (
      id INT(11) NOT NULL AUTO_INCREMENT,
      username VARCHAR(30) NOT NULL,
      pwd VARCHAR(200) NOT NULL,
      email VARCHAR(100) NOT NULL,
      created_at DATETIME NOT NULL DEFAULT CURRENT_TIME,
      PRIMARY KEY(id)
      );

  • @fotonext7441
    @fotonext7441 Год назад +1

    FOREIGN KEY REFERENCES must be PRIMARY KEY in the parent table, or can it be any column?

  • @yousifky
    @yousifky Год назад +1

    ❤🎉

  • @IEmirovic
    @IEmirovic Год назад +2

    Thanks Dani. I have a question. Do we need "username" column inside comments table? We can reach "username" column inside users table with "join" querys. Because we defined foreign key. Thanks again.

    • @Dani_Krossing
      @Dani_Krossing  Год назад +1

      You are correct, you would be better off doing a inner join SQL statement. 🙂

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

      ​@@Dani_Krossing Thanks! I had the same question. But to clarify a bit more, we don't need to add the "username" column in the "comments" table, right? We can just reference it to the "users" table through the foreign key "users_id", correct?
      Is there any reason to actually have this kind of "redundant" information in a database table?
      (On that matter, do you have any video about the key principles of structuring your SQL database? - With your teaching skills, I might finally be able to grasp that... 😅)
      Oh, and thank you so much for all this useful information and the perfectly structured course!!

  • @ArshiaMoharrary
    @ArshiaMoharrary 10 месяцев назад

    Maybe we have several IDs in the users table. On what basis does the database value users_id?

  • @omrwi
    @omrwi 6 месяцев назад +1

    Hi, I followed your instruction and encountered an error. The database did not accept CURRENT_TIME; instead, it accepted CURRENT_TIMESTAMP. Is there a different syntax to resolve this error? I am also using phpMyAdmin like you. Thank you!

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

    Pls upload a video for front end connected to back end use insert delete upload select update every things in one video . I'm a software engineer student . Your videos are very useful for me

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

      Once I'm done with this MySQL part of the course, the plan is to teach that. 🙂 I do have a older PHP course that shows it too, if you need it now.

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

      Please do python language also

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

      ​@@Dani_Krossing I need complete video of web-based application design with your explanation. I think it's useful for student

  • @noelradhakrishnan4423
    @noelradhakrishnan4423 Год назад +1

    I have a doubt though, shouldn't we refer the username from the users table as a foreign key to the comments table?

  • @typo368
    @typo368 Год назад +2

    Mine is throwing errors at the "DATETIME" statements in both tables, i deleted both of them and is good?

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

      im getting the same error.... did you find the solution?
      this is my error
      #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIME,
      PRIMARY KEY (id)
      )' at line 6

    • @Noah-qu9fb
      @Noah-qu9fb 6 месяцев назад

      i'm getting the same thing. from what i can gather from searching it, DATETIME will be obsolete in about 15 yrs? people seemed to lean toward using timestamp so...i just used that instead and stopped getting the error lol

  • @houssainhafed4180
    @houssainhafed4180 Год назад +1

    pls create Laravel course

  • @davescorneroftheworld1147
    @davescorneroftheworld1147 Год назад +1

    At 29:08 of this video when you created the TABLE, just above you we see two tables. "New" and "users", where did the "New" table come from?

    • @Dani_Krossing
      @Dani_Krossing  Год назад +2

      That’s not a table 🙂 that’s a button you can click to create a new table

    • @davescorneroftheworld1147
      @davescorneroftheworld1147 Год назад +1

      @@Dani_Krossing OK. Thank you very much for your time.

  • @bilalbeny4172
    @bilalbeny4172 10 месяцев назад

    I just have one note, by default when we define a column as a primary key, its is impossible to be null and must be unique, in other words: PRIMARY KEY = NOT NULL + UNIQUE, so we can not use NOT NULL constraint with a column when it's a primary key.

  • @samnako
    @samnako Год назад +1

    But Daniel, how do i join your patreon's? I live in Lagos, NIGERIA and I need to do so to support your works.

    • @Dani_Krossing
      @Dani_Krossing  Год назад +1

      If you would like to join, there is a link for either my Patreon, or my RUclips memberships, in the bottom of the description. 🙂

  • @elvisjunior2892
    @elvisjunior2892 3 месяца назад

    After I clicked go I got an error that said. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIME,
    PRIMARY KEY (id) )' at line 6

  • @HighfieldFarm-w1z
    @HighfieldFarm-w1z 9 месяцев назад +1

    We have the username in both the users table and the comments table? Is that ok? Seems to defeat the point of the relational db.

    • @hellofromiqbal
      @hellofromiqbal 8 месяцев назад +1

      Including the `username` column in the `comments` table alongside the `users_id` foreign key column depends on your specific requirements and design considerations.
      Having the `username` column in the `comments` table can be beneficial in scenarios where you frequently need to display comments along with the username without having to join the `users` table every time. This denormalization can improve query performance, especially in cases where you're frequently retrieving comments and displaying them with usernames, as it eliminates the need for a join operation.
      However, if you're concerned about data redundancy or prefer a more normalized database design, you can omit the `username` column from the `comments` table and rely solely on the `users_id` foreign key to associate comments with users. In this case, when you need to display a comment along with the username, you would perform a join operation between the `comments` and `users` tables to retrieve the username.
      In summary, whether to include the `username` column in the `comments` table depends on factors such as performance considerations, data redundancy, and your specific application requirements. Both approaches are valid and have trade-offs that you should consider based on your particular use case.
      At least this is what I got from chatGPT lol.

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

    What if, I want to make a note pad project, do i need to make a database for it?

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

    😘😘😘

  • @andymalunes8316
    @andymalunes8316 5 месяцев назад

    bro is there a difference between CURRENT_DATE CURRENT_TIMESTAMP, and CURRENT_DATE CURRENT_TIME?

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

    Do you have paid courses in Udemy?

  • @techgamer734
    @techgamer734 6 месяцев назад

    I am getting error that Foreign key constraint is incorrectly formed

  • @Dineshsharma-ec6ys
    @Dineshsharma-ec6ys Год назад +5

    Why php is dying language? And why people are running after javascript frameworks?

    • @Fred-lf4qb
      @Fred-lf4qb 8 дней назад

      Php is widely used my friend which universe are you in?

  • @andymalunes8316
    @andymalunes8316 5 месяцев назад

    bro isnt it supposed to be called rows instead of columns because it came from left to right and is horizontal?

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

    Why did we not use the field "ID" (PRIMARY KEY) in the Comments table as the FOREIGN KEY in references rather than creating user_id Field to act as a FOREIGN KEY ??

    • @Dani_Krossing
      @Dani_Krossing  Год назад +2

      Because the ID has to be unique to that particular entry, and not based on other tables. Otherwise a bunch of issues can happen. Primary Keys should not be Foreign Keys.

  • @heinzerbrew
    @heinzerbrew 9 месяцев назад

    What's the point of having an id when you already have a unique username?

    • @Dani_Krossing
      @Dani_Krossing  9 месяцев назад

      The ID is for the table row, which is different. There HAS to be a unique id for all rows of data, which isn’t up to the user to decide. Having the ID be a number, also makes it easier to list them all out if needed.

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

    Am getting user_id error.