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. 🙂
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 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. (:
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.
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🔥
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
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 :(
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.
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...
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 🙏
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.
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.!
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 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!!
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
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 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?
@@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) );
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
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
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!
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.
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.
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
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 ??
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.
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.
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. 🙂
Sorry bro for the loss
😢
😢Sorry to hear this all the best
:(
Sorry to hear. Can imagine you needed some time to it.
You are underrated, Daniel. Thank you for everything.
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.
Learning php at 73??? You're my Hero.
@@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. (:
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
This entire 40+ minutes video covers the entire unit of my uni course.
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.
Dani, you are awesome! You are a great teacher! Thank you for your videos!
This is awesome, thank you!
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🔥
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
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 :(
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.
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...
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 🙏
Thank you so much sir, have enjoyed the lesson
very help for a beginner ❤
very helpful, thank you
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.
Superb!
Very nice video. I was so into it
Dani Krossing deserves 1 Million subscribers
Yessssssssss
Thanks for the video
Thank you
thank you my brother 😍😍
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.
People on that forum are saying that this is not SQL at all, but MariaDB.
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.!
FOREIGN KEY REFERENCES must be PRIMARY KEY in the parent table, or can it be any column?
❤🎉
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.
You are correct, you would be better off doing a inner join SQL statement. 🙂
@@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!!
pls create Laravel course
Maybe we have several IDs in the users table. On what basis does the database value users_id?
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?
That’s not a table 🙂 that’s a button you can click to create a new table
@@Dani_Krossing OK. Thank you very much for your time.
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
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.
Please do python language also
@@Dani_Krossing I need complete video of web-based application design with your explanation. I think it's useful for student
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?
What is the full SQL that you tried to submit?
@@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?
@@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)
);
I have a doubt though, shouldn't we refer the username from the users table as a foreign key to the comments table?
But Daniel, how do i join your patreon's? I live in Lagos, NIGERIA and I need to do so to support your works.
If you would like to join, there is a link for either my Patreon, or my RUclips memberships, in the bottom of the description. 🙂
😘😘😘
Mine is throwing errors at the "DATETIME" statements in both tables, i deleted both of them and is good?
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
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
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!
What if, I want to make a note pad project, do i need to make a database for it?
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.
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.
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.
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
Do you have paid courses in Udemy?
I am getting error that Foreign key constraint is incorrectly formed
bro is there a difference between CURRENT_DATE CURRENT_TIMESTAMP, and CURRENT_DATE CURRENT_TIME?
bro isnt it supposed to be called rows instead of columns because it came from left to right and is horizontal?
Am getting user_id error.
Why php is dying language? And why people are running after javascript frameworks?
Php is widely used my friend which universe are you in?
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 ??
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.
What's the point of having an id when you already have a unique username?
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.