Это видео недоступно.
Сожалеем об этом.
PHP CRUD Tutorial with MySQL & Bootstrap 4 (Create, Read, Update, Delete)
HTML-код
- Опубликовано: 3 сен 2018
- Upgrade your Clever Techie learning experience:
/ clevertechie
UPDATE! (9/13/19) New features and improvements for Clever Techie Patreons:
1. Download full source code with detailed comments - easy to learn and understand code
2. Weekly source code file updates by Clever Techie - every time I learn new things about a topic I will add it to the source file and let you know about the update - keep up with the latest coding technologies
3. Library of custom Clever Techie functions with descriptive, easy to understand comments - skyrocket coding productivity, code more efficiently by using Clever library of custom re-usable functions
4. Syntax code summary - memorize and review previously learned code faster
4. Organized file structure - access all Clever Techie lessons, source code, graphics, diagrams and cheat sheet from a single workspace - no more searching around for previously covered material and source code - save enormous amount of time and effort
5. Outline of topics the source file covers - fast review of all previously learned coding lessons
6. Access to all full HD 1080p videos with no ads
7. Console input examples - interactive examples that make it easier to understand and learn coding
8. Access to updated PHP Programming Book by Clever Techie
Download this video's source code and additional files here:
/ 21201554
`````````````````````````````````````````````````````````````````````````````````````````````
In this PHP CRUD Tutorial we're going to create a fully functional PHP CRUD application with Bootstrap and MySQL. PHP CRUD stands for Create, Read, Update, Delete which is an easy way to memorize all the components needed for a fully dynamic web site application. We're going to be using MySQL statements called INSERT, SELECT, UPDATE, and DELETE which correspond to CRUD functionality.
Building the structure HTML : 2:00
* CREATE the db: 6:24
Start working on process.php file 7:38
Check if save button has been clicked 8:38
Create end and delete button 19:13
Creating the table above the 11:49
Showing you the data with pre_r() function 12:50
* READ from the db 17:07
* DELETE a record from the db 21:04
Start the SESSION 22:39
Click edit and display 27:16
Make sure the record exists: 28:33
* Update records from db 32:48
Bro we can do this code in notepad ++ right?
@@Hey-hv6oo Sure, why not?
@@gulfelectro Can you help me?Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file in C:\xampp\htdocs\Crud\index.php
That is for Update
It is a bad practice to write a connect line to connect to the database on every file. The reason why you should not do it is because whenever you have to move the project from your localhost to the actual server, you will have to edit the database info on every file. It is better to have one single file connecting to the database and just include it whenever you need it. Then you can edit one single file when moving project to the server. But thanks for the video, I learnt a lot following up the steps!
Ever tried xcrud . Google it such a nice framework
The best PHP CRUD tutorial to ever exist on the planet, it explains everything that i took ages struggling on doing it successful and in most efficient way. Thank you clever techie, i love your tutorials.
I agree
I agree too!
No need for a hidden input. First, add a new line: $id = $row['id'] in the IF block for fetching name and location. Then, in index.php add to the UPDATE button this value -> [value ="] . So now the id is sent to $_POST array when clicking the update button
Thank You Man This really helped
i hope you can help me with this I don't understand where to put the code. , is it on the process.php or in the index.php?
Great video, I'm usually very annoyed with youtube tutorials because people tend to skip the basics to an extent that it's very difficult to follow along unless you've already done alot of coding in the language, which you usually haven't done if you're watching a tutorial.
So kudos for being thurough!
except he skips shit right from the start. obvious bought comments are obvious
This is by far the most successful tutorial I've watched on PHP, MYSQL. I'd love to see a video on search function in the database, and pagination. Also, it would be good if you could depend on CSS3 instead of Bootstrap. I really appreciate the work. Thanks.
Thank you for the suggestions, I already have a video on pagination, will probably release one on search soon, stay tuned!
shalaw Fatah why css3 bro , if Bootstrap provides responsive styling just doubt!
@@clevertechie Have you released the video on database search?
wow that's perfect for coding without a framework. For the basic CRUD, everything has been thought and is decoupled between front end vs back end. Nice works! Another good video would be to show how to protect from SQL Injection, XSS, etc.
there is no sentence exist like"one of the best tutroial ". i'ld like to share my honest opinion this the no.1 best tutoriall ever i found in youtube..thnks clever techie
I really appreciate that!
This is a very good tutorial! Thank you Clever Techie!
If you ever encounter that your Delete Message Alert is not display...
Put a die() function right after the header('location: index.php');
It will look like this:
if (isset($_GET['delete'])){
$id = $_GET['delete'];
$mysqli->query("DELETE FROM data WHERE id = $id") or die( $mysqli->error());
$_SESSION['message'] = "Record has been deleted!";
$_SESSION['msg_type'] = "danger";
header('location: index.php');
die();
}
Thanks!!!!
Thank you for this! I got a little bit lost, but when i started it again then just focus hardly on what you're doing, i got it right! Tysm!
this is the most powerful (perfect) video about PHP crud i have ever seen
i am on my third day in php and this is the best tutorial i have encountered
Congrats. One of the best PHP tutorials I've seen so far! Well done.
Warning: count(): Parameter must be an array or an object that implements Countable in dashboard\projectCrud\process.php on line 36
Replace:
if(count($result)==1){
$row = result-fetch_array();
by:
if ($result->num_rows){
$row = $result->fetch_array();
thank u! ^_
thanks man this really helped me a lot
dafuq is num_rows
Parse error: syntax error, unexpected identifier "pre_r" in C:\xampp\htdocs\ARCHIVE-EDITED\announcement.php on line 207 how about this?
Thank You
Best crud tutorials so far, every is explained so clear that I am quite confident that I can write this part from scratch too without stealing other's code that I actually do not quite understand.
It work ?
Yes, it works like a charm. Have u encountered any problem?
finally my first PHP crud app is made. thanks clever techie. your way of demonstrating each step is very nice
I had some issues but i did it worked perfectly, very nice tutorial . Please upload videos like this , i would totaly love to watch and learn from them .
Hey man, I hope you're doing good, just wanted to thank you for posting this amazing tutorial, it really has helped me a lot, cheers!
Oooh, this is a fantastic video! Your picture describing CRUD to the analagous SQL statements is brilliant content. Thank you!
Thorough and EASY - as all things should be (LOL!). 5 stars on all metrics
*keep it coming I can watch them all
I'm really shoked to see this tuto...because u saved million of time of others... Thanks a lot for such a good tuto ..
function count() is incorrect.
Solution: if($result->num_rows){
$row = $result->fetch_array();
is this because of the version of php?
@@marcelinolibrada6761 I think so. (Smiles)
Thanks a lot
@@andreluisdacostapaes1361 can you specify how can i modify that code ? i still don't understand
thanks... it helps a lot
Youre TUTORIAL IS THE BEST i found so far . BIG THANKS exactly like i need the details of the code. Very nice.
This is the best CRUD Tutorial I have ever studied. Thanks a lot Sir.
Great Content Techie...
People will really appreciate your work...
Thank you brother.
i've been using this video and it's really helping me a lot, because i was having a lot of errors and thx to your video i'm goin thru all them
Hi! if you want to learn, The Complete PHP MySQL Professional Course with 5 Projects. here is a link.
ruclips.net/video/4x3FhyS8muc/видео.html
THX YOU, DUDE! REALY! I HAVE TROUBLE FOR 4 DAY WITH LABS FROM MY UNIVERSITY WITH THIS SHIT. YOU HELP ME SO MUCH!
You really helped me passing the 12º grade ty my brother!!!
Really thank you very much. The most helpful and comprehensive video about php I have watched. You answered nearly all my questions in this video. Thank you again and again
You are welcome!
Thank you for this tutorial I really appreciate it. It helps us with our capstone for our backend, Kudos Cleaver Techie 💪💖
Glad you like it!
GREAT TUTORIAL MUST CHECK FOR MAKING RESPONSIVE WEBSITE . COMPLETLY WORKING AND HELPED A LOT FOR COMPLETING MY PROJECT.
thank you sir for making these video for us.
Had problems with some old MYSQL functions that don't work in MYSQLI but overall everything was perfect, thank you so much!
I'm still having problems because of this. Can you share the source code?
Awesome tutorial, Thank you!! Its fast but I like it, I just pause sections I need more time on.
Woah woah woah! There are some serious problems with this tutorial. 1) database security - google "sql injection" to understand the problem and "mysqli prepared statements" for the solution (although PDO is the de facto instead of mysqli), 2) XSS vulnerabilities - google "xss php" and there are a variety of solutions, htmlspecialchars() is the easiest, twig is popular too 3) probably other security concerns, i only skipped through the video but user submitted data or data from the db should be considered toxic and will ALWAYS require special handling, 4) using die() instead of exceptions (which can be handled) is really bad practice. There is a lot more I could say about this but the above points are critical. Phpstorm with the ea inspections plugin will warn beginners about a lot of bad habits and once you've played with the basics I'd recommend composer to download libraries/frameworks that promote good coding practices
Such a good tutorial! Learned a lot. Also about your cheat sheets. Clever to have code in your notes to easy copy/paste. Thank you :)
This is the well-paced nuts & bolts tutorial I've been looking for, thumbs up!
MY edit process did not work with de if(count($result==1)). I did need to change to $results->num_rows to work. Why?
im getting this message error , how to fix it
Notice: Undefined variable: mysqli_error in C:\xampp\htdocs\log\process.php on line 35
Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\log\process.php:35 Stack trace: #0 C:\xampp\htdocs\log\crud.php(10): require_once() #1 {main} thrown in C:\xampp\htdocs\log\process.php on line 35
@Harold Mendes not phpmyadmin but PHP
Thank you so much for such an awesome tutorial, it helped me alot to clarify concepts and implement flawlessly... Thanks alot man!!
Thumbs up from Pakistan helped me a lot in my subject Web-Eng assignment on CRUD in University of Lahore. Thanks.
For delete fuction must be a confirmation message firt before delete action
Thank a lot man for this amazingly easy to learn tutorial!
please help! :(
count():Parameter must be an array or an object that implements Countable; it gives this error when I click edit button.
@Harold Mendes Thank you, this is worked for me.
@Harold Mendes Thank you!
@Harold Mendes Doesn't worked for me , just a blank page in localhost/...edit=2
@Harold Mendes Doesn't work for me "count():Parameter must be an array or an object that implements Countable; it gives this error when I click edit button."
Thanks a lot man, it was very very interesting the whole 2 days that took me to make this. Can't wait to start seeing your other videos
i dont mean to be off topic but does someone know a trick to get back into an instagram account??
I was stupid forgot my login password. I would appreciate any tricks you can offer me!
@Daxton Jace instablaster :)
@Bodie Ismael thanks for your reply. I found the site thru google and im in the hacking process now.
Looks like it's gonna take a while so I will reply here later with my results.
@Bodie Ismael it did the trick and I actually got access to my account again. I am so happy!
Thanks so much you saved my ass :D
@Daxton Jace Glad I could help xD
Perfect and easy! Thank you very much and greetings from Hungary!
This helped me out so much!! I was wondering how this could be used if there were multiple tables in the database and not just the data table
Thank you very much I was struggling with the update operation for hours and u saved me! by the way it's my first video to watch in your channel!
I got a error when using Count on line 35, "Parameter must be an array or an object that implements Countable", but $result is a object, any help?
By far one of the best turorials!
Error No1 : Warning: count(): Parameter must be an array or an object that implements Countable in C:\php\www\Sample\process.php on line 39
Error No2: Error: Call to a member function fetch_array() on boolean in C:\php\www\Sample\process.php on line 40
Everything else works perfectly only these two errors when the edit button is clicked. Any solutions?
write *mysqli_num_rows($result) == 1* instead
@@dandi2864 It works for me! Thx!
thank you bro it worked for me
Thank you for the really helpful tutorial! I appreciate it. it was helpful in my project.
You're the best teacher. Thank you so much!!
Thank you for the really helpful tutorial! I appreciate it.
Hi! if you want to learn, The Complete PHP MySQL Professional Course with 5 Projects. here is a link.
ruclips.net/video/4x3FhyS8muc/видео.html
Thank you so much for this amazing tutorial. It helps me alot!
i love your tutorials,... that was the best php lesson
i got an error on $result variable inside if count condition when i am putting the terminator after initialization the row variable. 29:02
Super useful tutorial. Learned a lot and got more motivated!
Great tutorial, thank you for all your super-helpful videos! I am following along step-by-step and have encountered an issue at the ‘Edit’ user section.
You put your ‘SELECT * FROM data WHERE id = $_GET[‘edit’]’ query and variable-setting logic in the process.php file as if it was supposed to be called when the Edit button is clicked. But, the Edit button’s href target is itself, the index.php page. How is the code in process.php to retrieve the selected user’s record being invoked and how are the updated $name and $location variables getting passed back to index.php?
I had to put the query and variable-setting logic in the index.php file above the add/edit form to get it to work.
I thought I was getting this really well but am really confused now - I don’t understand how your code works since:
1) you aren’t calling the process.php file when you click an ‘Edit’ button,
2) nor are you passing any SESSION or GET variables back to index.php from the Edit code in process.php even if you got there somehow.
I’m sure I’m missing something obvious but I am stumped right now.
Thanks!
The way i solved this is by putting that code in a seprete file and including it at the top of my page. But i dont know how he did it
Just assign variable as id, use ' for variables in the query..
if (isset($_POST['update'])) {
$id = $_POST['id'];
$name = $_POST['name'];
$location = $_POST['location'];
$result = $mysqli->query("UPDATE data SET name = '$name', location = '$location' WHERE id = $id") or die($mysqli->error);
$_SESSION['message'] = "Record has been updated";
$_SESSION['msg_type'] = "warning";
header("location: index.php");
}
Rock Shan Thanks!
@@rockshan6306 Thank you very much!
Steve Carter, and thank you very much for your good question.
The save message appears, but the delete message doesn't appear
Very helpful ... easily understabl tutorial 👍
Awesome work mate, everything works perfect
it just like drowning man catches at straw.. its really amazing video thanks sir!
Thanks alot man great help for my sem project.
Thank u for this tutorial. it saved my life
Simple, Easy, Worthful
When i click update it just shows me a blank page. Doesnt update the database also. Just takes me to process.php. Please help!
Check that name and location variables goes to process page.
same with me .. did you solve this??
Thank you for your help, really need this help for my capstone project
You're welcome!
thank you so much! it help me doing my project assignment!
Great video. Thanks a lot from Brazil!
You are welcome!
Fantastic tutorial. Pretty much as clear as it can get
_
: ×[.arya_suka.]×:
29:15 Process.php line 34 array warning error due to count function use this function error will be finished
if (array($result) !==null){
$row = $result->fetch_array();
$name = $row['name'];
$location = $row['location'];
Great
$row = $result->fetch_array();
if ($row){
$name = $row['name'];
$location = $row['location'];
}
thank you for saving me time^^
Thanks a lot
It's too good 😃 thanks it helped me ✨
Nice tutorial this is what i have been searching for.
thanks its really helped me in my project
thanks,
i want to understand why if(@count($result)==1) is error? (without@)
Thanks for this tutorial... Which editor are you using?
NetBeans
This really help me a lot! Thank you
sir you are great. My admiration from Colombia. Thank you
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
Try to check the $mysqli->("UPDATE data SET name='$name', location='$location' WHERE id=$id") or die($mysqli->error); line in process.php very carefully, i had one comma in wrong spot and got the same error
@@MHMtt66 got the same error any solution ?
23:41 : Only problem I've had is that the div that handles the alerts will show the alert-success, but when the delete button is pressed on a record the alert-danger does not show up.
Really clear content! Well outline on what to do list. Thanks!
thank you for this tutorial i was trying to find throwing information message with header function. This is good
Amazing .. so easy to follow. You are a great teacher.
Very informative! All the code works perfectly well!
I'm sorry I am new to programming I am developing my first CRUD app and this tutorial is amazing. Is it necessary to use NetBeans as an IDE Or can I simply use VS Code? Thanks!
Thank you master sifu. Learned a lot from this video.
love this concise tutorial.. thank you!
Hi, I have a trouble with edit function. If I clicked the edit, it gets id correctly, but my window(browser) gets into blank page. Anyone can help?
Thank you man! This helped me so much
Thank you, I have created the same application as you taught.
hi this is probably the most helpful tutorial I've watched thus far so thank you so much! However i am trying to accomplish this task using bootstrap modals? how would i implement this? I am a beginner to coding and have been struggling with this all week... would really really appreciate it if you could provide guidance on this! Thanks
Good video with BIG MISTAKE. require_once 'process.php' is not needed at all inside index.php. In fact you didn't show redirect at all also. is missing but that is a minor mistake.
it is really awesome tutorial, clear cut and u r the master...really appreciate your work.
Thank you for making this tutorial! This is very helpful for me :)
I get this error when I click the Edit button - Warning: count(): Parameter must be an array or an object that implements Countable in process.php on line 42
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '> Warning: Use of undefined constant n - assumed 'n' (this will throw a' at line 1
Very neat and well organized, Good job saviour!
Of course! Yes I am savior! :)
Definitely a great tutorial. Thank you!
Glad you enjoyed it!
Very easy to understand and short code..good
can I ask why did you require the process.php before the action attribute. I understand why for the action attribute but why add it before also what will happen if you don't. Thank you
Thank You Clever Techie. This video is what I really need!!
Hi! if you want to learn, The Complete PHP MySQL Professional Course with 5 Projects. here is a link.
ruclips.net/video/4x3FhyS8muc/видео.html