Finally, a PHP tutorial that renders PHP down in the HTML code. So many tutorials out there where they don't show you how to add PHP with your HTML, especially for repeated regions.
i wake up today telling myself 'aaah i have to learn that SQL+PHP stuff...' and before looking for it, there it was, in my feed. You're freaking me out! Thank you!!
It's not him is google. Now google can read our mind with Ai lol. I had video in my fee with problem I had in my mind that I didn't even look on google or youtube!
Some people are just blessed with the gift of sharing knowledge. Brad, you are blessed with that gift. I have never used MySQL and have never learned it before but after watching this video, I feel like an expert. I will check out your other video you mentioned regarding MySQL. Thank you once again for a job well done.
Thanks for continuing to keep this series updated, Brad. I can only speak for myself, but I'm really enjoying it...and no worries about the delay in getting parts up, it gives me time to go back and write test code to make sure I really understand each part before going on to the next one. Cheers!
Thanks so much for all this, Brad. Just a note that in real world application, the entire section of the page should *not* be put in a common header unless you define all your page titles and descriptions dynamically, so that they're not the same across every page.
If someone is getting an error at 11:23, check also how you named the table in the database - post or posts. If it was post change all posts to post in the index.php file.
Hi Brad, for preparing SQL queries, it is VERY handy to use HEREDOC sintax. The easiest way to prepare strings. No escape needed at all. And also valiables are evaluated. BIG THANKS for your tutorials.
Thank you for all your videos Brad. There are lots of videos on coding, but your videos are the one that help with real projects. The way you explain things really click and the things you explain are really important.... I actually utilised everything taught in this video in a CMS/Blog project I am currently working on. Though I improvised a lot, but what you taught makes the foundation upon which I am building. Thank you again.. and all the very best with everything... Regards.
i just want to say thank you for being such a nice person and share all this knowledge for free, your heart is big like the universe ,may god bless you and your family
This was an Outstanding Lesson! Super fun and I learned a lot of really cool functional uses of PHP using SuperGlobals and Includes. My favorite part was the Bootstrap Navbar at the ending [had to 'develop' a bit on my own cuz Bootstrap has changed a bit since this was released]. That was the most straightforward demonstration of how to scaffold using Bootstrap I've ever seen. This has been a very valuable resource and I'm super thankful I have access to it. Thanks Brad!
Hey Brad. In SublimeText when you click new folder, first you need to give a name hit enter then you folder will add to the project, look at the 22:57 on the bottom you need to name you folder. Thanks for your videos, i like the way you teach, i have learned alot! keep up the great work.
Did you guys noticing how VC code becoming better and better? For me, Atom is kind of slow and buggy and I think many will start to flee toward VC code (like myself) and eventually, I'm afraid, VC code will start to cost money when VC suppress Atom. I'm afraid Atom will start to fading away without stable fonding.
Can't wait for the next one! I've been looking for a tutorial on how to submit form data to a database for a week now and can't get something that works for some reason.
This one worked like a charm and following along makes me feel like I've grasped a bit more of the concepts even though obviously I couldn't do this on my own yet. But overall great project thanks a ton!
It isn't because in the index.php and post.php files he first require config.php and then db.php so each time he run index or post the server will run config.php and define the constant and only them use it on db. If you would only run the db.php then u would need to require it. Hopefully its clear haha.
If you are taking any requests (and I know it is too much to ask but ;) before getting in to the forms or while getting in to the forms ( because I am sure we will be getting in to POST, PUT and possibly DELETE functions.) -Is it possible for you to create a second table for Tags, left_join it with the post tables and use Split function to populate the tags. So when you will create the forms, you create another input text box to make the tags and the amount of spaces that you have for input will split the input words in to tags. -Is it possible to use Sha Hashing /Hashing that is offered by JQuery for admin login? This is just a request, it is all good and understandable if you are planning to keep this tutorial just simple and on point. As for this tutorial. Thank you for the update on php series. I really admire your work and you are indeed an extremely reliable source for developers / web developers like me.
how to know which localhost is running in my machine Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\phpsandbox\blogs\index.php on line 4 failed to connect ot MySQl1045 I'm getting this error when I use localhost
Hi Brad, I love your tutorials here on UA-cam and been watching them for a while now and they are very good. Maybe a bit off topic but can you do a tutorial(series) about Docker. That would be very nice. Thanks in advance!
damn! programming is enjoyable as fuck! I love it! I've been coding for several years, but never it had never tasted good as now! thanks brad for great tutorials.
Hi, following your video works well, but when i want to pull the FULLNAME field from a different table it constantly gets an error, i am guessing this is because the script it only pointing at the original table, so how would i include a second table for this to look into to find a vairable (FULLNAME)
I get an error saying that my array key "id" is not defined in the post.php file, my code is the same as yours. Do you maybe have an idea why I get that error?
mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost'(using password: YES) what's this mean? Actually I'm newbie in PHP so I don't know much about stuff like that so anyone? I need some help
It helps keep everything nicely organized. If this info changes in the future you can access and change it instantly without having to scroll thru several lines of code. It shouldn't break. Perhaps you forgot to require the file?
I have done what you said, but if i continue like this that means i will create a php file for each post is that right? and is there another way not to do that.
really awesome man ! do you have any good practises or other courses about php to do while im waiting for you to upload ? your course on udemy was really advanced so i had to quit
I have a question, guys. Every time I use bootswatch the background of the different boxes doesn`t appear. Like Post One and Post two has a grey box or the background of the navbar. For me, only the text appears and nothing else. Can you help me, please? Thank you!
For anyone (like me) creating this database in SQL code: Create database: CREATE DATABASE phpblog; Switch to database: USE phpblog; Create table: CREATE TABLE post ( id INT(11) AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255) NOT NULL, body TEXT NOT NULL, author VARCHAR(255) NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); Add value to table: INSERT INTO post (title, body, author) VALUES ( 'Post One', 'This is my very first post on this awesome blog', 'Joshua' );
hi Brad, is it safe to put the user name and password for you database inside the html (doesn't this expose the details to anyone using the website)?.??... could you do a tutorial on security / logins and redirecting if user is unauthorised??
Did anybody else NOT get the config.php file working? It just messed up everything. We don't even require the file inside db.php but somehow Brad can call the DB_... we defined? I'm getting errors that those are already defined.
Hi Brad, thanks for the video! One question, I'm getting, "Fatal error: Uncaught Error: Call to undefined function mysqli_fetch_all()" and "Stack trace: #0 {main} thrown" - code all looks the same, any idea what might be causing this? Thanks in advance.
Like you did in your video in 7 mins 10 seconds that error when you change root to root1 eroor appears , it doesnt appear on mine and basically my whole thing is unresponsive , Please tell how to fix it
The links to the bootswatch.com CSS files you keep using in this series no longer work. And you should probably be using something besides the default class because it's not producing the desired results. Primary might be a better choice.
Fatal error: Uncaught Error: Call to undefined function mysqli_fetch_all() Mysqli fetch all doesn't work with my sever. Does anyone have another method they can share?
I am keep getting an error at $post = mysqli_fetch_assoc($result); Fatal error: Call to undefined function mysqli_fetch_all() in index.php on line 12 Any ideas Brad?
Hey, I keep getting an error when I'm trying to var_dump(), as the result I get is "NULL". I think it's because I get this error: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) Anyone have any experience dealing with this? :/
Thanks for the video! At minute 9:00 you mention a SQL beginner to intermediate series but I didn't see it get linked. I've found these two videos from you but want to double-check to see if they're the correct series you're referring to in the video. ua-cam.com/video/9ylj9NR0Lcg/v-deo.html&ab_channel=TraversyMedia ua-cam.com/video/nWeW3sCmD2k/v-deo.html&ab_channel=TraversyMedia If those aren't it, which is the link to the MYSQL video series that you're referring to?
Traversy Media I actually built an administrative part for the blog but I was wondering how do I actually prevent users from navigating to the admin part of the application. Thanks in advance
I feel dumb, man. Do you all understand what all of this means? $result = mysqli_query($conn, $query); $posts = mysqli_fetch_all($result, MYSQLI_ASSOC); mysqli_free_result($result);
In my opinion, you can't expect someone to teach you all the ins and outs of a language for free. It would be very rare to find such a thing. And that's quite normal actually, these developers are people who need to earn money for a living, so it just can't be all for free. I guess there are paid courses that will teach you that in depth. Brad has done more than enough giving you the core fundamentals of PHP, then it's up to you to develop your PHP skills either by looking at the documentation or enrolling in some paid course.
Thank you for your time in making this video. Thank you for helping others on a path to providing a better life. Blessings to you and your family.
You tuts are simple and easy to follow.
As a beginner, I am to follow what you are teaching without much difficulty.
Thank you.
Hey man, you actually do not know, you are getting thousand of blessings from us. You are simply UA-cam legend. #respect
Finally, a PHP tutorial that renders PHP down in the HTML code. So many tutorials out there where they don't show you how to add PHP with your HTML, especially for repeated regions.
i wake up today telling myself 'aaah i have to learn that SQL+PHP stuff...' and before looking for it, there it was, in my feed. You're freaking me out! Thank you!!
It's not him is google. Now google can read our mind with Ai lol.
I had video in my fee with problem I had in my mind that I didn't even look on google or youtube!
Some people are just blessed with the gift of sharing knowledge. Brad, you are blessed with that gift. I have never used MySQL and have never learned it before but after watching this video, I feel like an expert. I will check out your other video you mentioned regarding MySQL. Thank you once again for a job well done.
Thanks for continuing to keep this series updated, Brad. I can only speak for myself, but I'm really enjoying it...and no worries about the delay in getting parts up, it gives me time to go back and write test code to make sure I really understand each part before going on to the next one. Cheers!
Thanks so much for all this, Brad.
Just a note that in real world application, the entire section of the page should *not* be put in a common header unless you define all your page titles and descriptions dynamically, so that they're not the same across every page.
If someone is getting an error at 11:23, check also how you named the table in the database - post or posts. If it was post change all posts to post in the index.php file.
Hi Brad, for preparing SQL queries, it is VERY handy to use HEREDOC sintax.
The easiest way to prepare strings. No escape needed at all. And also valiables are evaluated. BIG THANKS for your tutorials.
Thank you for all your videos Brad. There are lots of videos on coding, but your videos are the one that help with real projects. The way you explain things really click and the things you explain are really important.... I actually utilised everything taught in this video in a CMS/Blog project I am currently working on. Though I improvised a lot, but what you taught makes the foundation upon which I am building. Thank you again.. and all the very best with everything... Regards.
To be honest, I like videos with "face time :D". It brings you closer to us.
Keep up your good work!
i just want to say thank you for being such a nice person and share all this knowledge for free, your heart is big like the universe ,may god bless you and your family
This was an Outstanding Lesson! Super fun and I learned a lot of really cool functional uses of PHP using SuperGlobals and Includes. My favorite part was the Bootstrap Navbar at the ending [had to 'develop' a bit on my own cuz Bootstrap has changed a bit since this was released]. That was the most straightforward demonstration of how to scaffold using Bootstrap I've ever seen. This has been a very valuable resource and I'm super thankful I have access to it. Thanks Brad!
when you were clicking 'new folder' it was actually working but was hidden behind your windows taskbar and was half visible. Nice stuff btw.
Hey Brad.
In SublimeText when you click new folder, first you need to give a name hit enter then you folder will add to the project, look at the 22:57 on the bottom you need to name you folder.
Thanks for your videos, i like the way you teach, i have learned alot!
keep up the great work.
Ahh, I've been using Atom.io too long :)
Did you guys noticing how VC code becoming better and better? For me, Atom is kind of slow and buggy and I think many will start to flee toward VC code (like myself) and eventually, I'm afraid, VC code will start to cost money when VC suppress Atom. I'm afraid Atom will start to fading away without stable fonding.
Can't wait for the next one! I've been looking for a tutorial on how to submit form data to a database for a week now and can't get something that works for some reason.
You are a life saver Brad!!
awesome helped a lot to understand php in short time
This one worked like a charm and following along makes me feel like I've grasped a bit more of the concepts even though obviously I couldn't do this on my own yet. But overall great project thanks a ton!
I have used php for some months now, and I learned about the include html trick - somehow never knew this... thanks!
7:50 create new folder - down below in st3- clear field )
Hi Brad. This was awesome I have learned a lot. Please but PLEASE continue with this series! You are awesome!
Make sure you check the PDO video as well. Ill be doing more with PHP very soon
I am doing that right now, because I need to query DB2 database with php, and add data to the mysql after that. Thanks for your reply.
If styling (navbar + "well" class) doesn't look right, you can change "4" into "3" in the link below:
bootswatch.com/4/cerulean/bootstrap.min.css
Cheers bro I was wondering why it aint working, inspecting elements and all.
OMG Thank you so much kind sir, I was wondering for almost an hour why the navbar is not working
I'm confused in 22:27 you set the $conn with the constant created in config.php. Is it not necessary to use require('config/config.php'); ?
It isn't because in the index.php and post.php files he first require config.php and then db.php so each time he run index or post the server will run config.php and define the constant and only them use it on db.
If you would only run the db.php then u would need to require it.
Hopefully its clear haha.
@@fabiodeabreu723 thanks!
If you are taking any requests (and I know it is too much to ask but ;) before getting in to the forms or while getting in to the forms ( because I am sure we will be getting in to POST, PUT and possibly DELETE functions.)
-Is it possible for you to create a second table for Tags, left_join it with the post tables and use Split function to populate the tags. So when you will create the forms, you create another input text box to make the tags and the amount of spaces that you have for input will split the input words in to tags.
-Is it possible to use Sha Hashing /Hashing that is offered by JQuery for admin login?
This is just a request, it is all good and understandable if you are planning to keep this tutorial just simple and on point.
As for this tutorial. Thank you for the update on php series. I really admire your work and you are indeed an extremely reliable source for developers / web developers like me.
Finally.............................................................................................. thanks Man
once again thank you so much! it all starts to make sense after your explanations!
These tutorials are just incredible! Thank you so much!
Thanks for these well explained lessons.
Will you ever make a tutorial on how to build a multi language site with PHP?
13:45 ...He displays the "title" and "created_on" values of array $posts.......but uses $post instead of $posts .....is that alright?
$post because he use Foreach .. so he iterate throught the assoc list
You might also have to specify the port you are using when you connect to the database. I was using MySQL Server and I had to say 'localhost:3307'.
This saved me from a massive headache, thank you.
how to know which localhost is running in my machine
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\phpsandbox\blogs\index.php on line 4
failed to connect ot MySQl1045
I'm getting this error when I use localhost
Awesome vid as always. So this video just uses only procedural PHP? ( I remember him mentioning both object and procedural at 0:53)
Hi Brad, I love your tutorials here on UA-cam and been watching them for a while now and they are very good.
Maybe a bit off topic but can you do a tutorial(series) about Docker. That would be very nice. Thanks in advance!
Thank you for your job man!Where I can get your Laravel course?
code from video gives error , please give source code with corrections
14:16 my output is very different from the video... the div of post one and post two box shadow... i don't have it
same, its something to do with the bootstrap template i think
Use this instead.
damn! programming is enjoyable as fuck! I love it! I've been coding for several years, but never it had never tasted good as now! thanks brad for great tutorials.
Hi, following your video works well, but when i want to pull the FULLNAME field from a different table it constantly gets an error, i am guessing this is because the script it only pointing at the original table, so how would i include a second table for this to look into to find a vairable (FULLNAME)
I get an error saying that my array key "id" is not defined in the post.php file, my code is the same as yours. Do you maybe have an idea why I get that error?
mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost'(using password: YES)
what's this mean? Actually I'm newbie in PHP so I don't know much about stuff like that so anyone? I need some help
Check your password, it's not the same as what you put while creating mysql root user.
If you didn't set one then try this : mysql -u root -p mysql
I also need help on this....
Bit confused as to why you included 'ROOT_URL' to the index.php file. It only breaks things on my end, and seems unecessary in general.
It helps keep everything nicely organized. If this info changes in the future you can access and change it instantly without having to scroll thru several lines of code. It shouldn't break. Perhaps you forgot to require the file?
mysqli_connect doesn't work.
Can't find any solution :(
I have done what you said, but if i continue like this that means i will create a php file for each post is that right?
and is there another way not to do that.
Why wasn't config.php required in the navbar to use the ROOT_URL like in the index.php and post.php?
the $_GET['id'] from where gets its ID? from database or from index.php? thanks!
Thanks, have donated via pay pal
Thank you man. I REALLY appreciate it. More content coming and I won't disappoint you
really awesome man !
do you have any good practises or other courses about php to do while im waiting for you to upload ?
your course on udemy was really advanced so i had to quit
I have a question, guys. Every time I use bootswatch the background of the different boxes doesn`t appear. Like Post One and Post two has a grey box or the background of the navbar. For me, only the text appears and nothing else. Can you help me, please? Thank you!
I think it's because they changed the bootstrap itself
Years passed
source code please, link is not working
11:57 how do you move the text?
tab
How do you move it left? Tab is right but if I hit backspace it deletes the text
For anyone (like me) creating this database in SQL code:
Create database:
CREATE DATABASE phpblog;
Switch to database:
USE phpblog;
Create table:
CREATE TABLE post (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
body TEXT NOT NULL,
author VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Add value to table:
INSERT INTO post (title, body, author)
VALUES (
'Post One',
'This is my very first post on this awesome blog',
'Joshua'
);
In building this website, did you use a specific MVC framework or its just pure php? Thanks
This whole series is pure PHP, no framework
Thanks.
hi Brad, is it safe to put the user name and password for you database inside the html (doesn't this expose the details to anyone using the website)?.??... could you do a tutorial on security / logins and redirecting if user is unauthorised??
Did anybody else NOT get the config.php file working? It just messed up everything. We don't even require the file inside db.php but somehow Brad can call the DB_... we defined? I'm getting errors that those are already defined.
Can I select TEXT in place of VARCHAR? Thanks
Hi Brad, thanks for the video!
One question, I'm getting, "Fatal error: Uncaught Error: Call to undefined function mysqli_fetch_all()" and "Stack trace: #0 {main} thrown" - code all looks the same, any idea what might be causing this? Thanks in advance.
Did you know what went wrong? Im getting the same error
Same here, any solution?
Like you did in your video in 7 mins 10 seconds that error when you change root to root1 eroor appears , it doesnt appear on mine and basically my whole thing is unresponsive , Please tell how to fix it
cool bean Brad.... thanks for the video
22:39 - The moment when you realize that this video should've been under 15 min
Can someone explain to me the part where he uses a link to send the parameter via URL.I mean wouldn't it be the same if he used
You're the best Brad! But for some reason my application doesn't like
$id = $_GET['id']; It throws a variable undefined. Any ideas?
Perhaps it has to do with the query string that you inserted in the URL in the a-tag? Just a suggestion, I can be wrong
@@circulardep Your ID is probably in caps in the database. I wasn't returning the ID and I couldn't figure out why until is called ['ID'].
I also unable to use id in single post.php it's says undefined variable
Thanks a lot. Clear explanation !
Why does db.php not require config.php to pass DB_NAME etc?
how to made for this limit list posts and pagination?
very good explanation Brad ! :)
I'm commenting a year later and everything works until the loop. the array is store in the variable but the loop doesn't work for me. Some body help!
The links to the bootswatch.com CSS files you keep using in this series no longer work. And you should probably be using something besides the default class because it's not producing the desired results. Primary might be a better choice.
Awesome, but why don't use php 7.1 and PDO?
I will eventually get to PDO. I want to cover both. I will also do a MySQLi OOP video
Fatal error: Uncaught Error: Call to undefined function mysqli_fetch_all()
Mysqli fetch all doesn't work with my sever. Does anyone have another method they can share?
I am keep getting an error at
$post = mysqli_fetch_assoc($result);
Fatal error: Call to undefined function mysqli_fetch_all() in index.php on line 12
Any ideas Brad?
Me too. try $posts = mysqli_fetch_array($result, MYSQLI_ASSOC); as a starting point. worked for me.
1) 00:38 .
Hi Do you have the source code here so I can test?
Did you make that chrome start screen yourself?
No it is an extension called Momentum
ahh okay, thanks.
I don't get the part where you use $_GET['id']...How does the id end up there?
iam getting an error 2
Hey, I keep getting an error when I'm trying to var_dump(), as the result I get is "NULL".
I think it's because I get this error: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)
Anyone have any experience dealing with this? :/
please upload next part :) thanks !!
wow. helped me a ton!
nice one
var_dump($posts); won't do anything ...
Thanks for the video! At minute 9:00 you mention a SQL beginner to intermediate series but I didn't see it get linked. I've found these two videos from you but want to double-check to see if they're the correct series you're referring to in the video.
ua-cam.com/video/9ylj9NR0Lcg/v-deo.html&ab_channel=TraversyMedia
ua-cam.com/video/nWeW3sCmD2k/v-deo.html&ab_channel=TraversyMedia
If those aren't it, which is the link to the MYSQL video series that you're referring to?
Thank you
WTH at 6:40 cracked me up
please upload php codeigniter parts
I'm working on it. Should be soon
Kushal Chavan hey people still use CI? laravel is better imho
Yeah I think so. I think CI is a great framework to learn the basics of MVC. Laravel is better though in my opinion
Traversy Media I actually built an administrative part for the blog but I was wondering how do I actually prevent users from navigating to the admin part of the application. Thanks in advance
it helps alot
Mysqli is deprecated. in the latest version of PHP it's showing a alert message that Mysqli is going to be removed soon
this was very confusing I had no idead what is going on
check out his tutorials on just mysql first then come back
I feel dumb, man. Do you all understand what all of this means?
$result = mysqli_query($conn, $query);
$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);
mysqli_free_result($result);
I guess I'm not really sure what the functional difference between mysql_query and mysql_fetch is?
Okay I managed to add a delete post button from by myself. I think im starting to understand
you are not teaching a language you are just using some functions in a programming language without explaining them properly .
In my opinion, you can't expect someone to teach you all the ins and outs of a language for free. It would be very rare to find such a thing. And that's quite normal actually, these developers are people who need to earn money for a living, so it just can't be all for free.
I guess there are paid courses that will teach you that in depth. Brad has done more than enough giving you the core fundamentals of PHP, then it's up to you to develop your PHP skills either by looking at the documentation or enrolling in some paid course.
thank you