How to do Simple CRUD Operations in WordPress with Elementor

  Рет қаралды 55,519

Tony Teaches Tech

Tony Teaches Tech

Күн бұрын

Пікірлер: 116
@rmt3589
@rmt3589 3 жыл бұрын
Met a backend web developer at a restaurant today and he suggested elements for php in WordPress. I've only done frontend web design, and I'm working on learning python rn. Thank you for making this! It's my introduction to WordPress, elements, and php.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Happy to help!
@johnpocock6018
@johnpocock6018 3 жыл бұрын
Another awesome CRUD movie from Tony, well done, I enjoyed them both. I am learning to code again after many years. You sped up the learning curve. Keep up the good work. cheers John
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Glad you enjoyed it. Good luck with getting back into coding!
@MJ-qe5lg
@MJ-qe5lg 3 жыл бұрын
Wow! That's is what I asked for. I am so impressed with what you just taught me.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Glad it was helpful M J!
@helpmeoh4249
@helpmeoh4249 3 жыл бұрын
I will love more videos like this.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Sure thing Ishmael
@helpmeoh4249
@helpmeoh4249 3 жыл бұрын
Thank you so much brother. Can you make more videos like this one. On how to implement crud, ajax with elementor.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Thanks, I will try
@alakshyapublicschool8554
@alakshyapublicschool8554 Жыл бұрын
very nice Tony you are really so simple
@TonyTeachesTech
@TonyTeachesTech Жыл бұрын
Thank you kindly
@muse2182
@muse2182 7 ай бұрын
Hello Tony enjoyed your video v much. Question: if there are more 1 elementor form "add" buttons, how does the hook in the child theme tell the difference between different elementor form data posts?
@JanarthanamAanandan
@JanarthanamAanandan 2 жыл бұрын
Useful video that im looking for. I have a question. How do I pass warning or any other massage to the view page after the form submitted. Thanks
@stanleyaloh7977
@stanleyaloh7977 3 жыл бұрын
your workspace is awesome, and I learnt alot of from this, thanks!
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
I appreciate that Stanley!
@dotbhav
@dotbhav 3 жыл бұрын
Amazing! Thanks for this tutorial.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
You're very welcome!
@droidcrunch
@droidcrunch 3 жыл бұрын
Very nice tutorial mate.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Many thanks!
@mriservice1671
@mriservice1671 3 жыл бұрын
Best tutorial ever! ..... Keep going! How do we make it so that people can only CRUD their own records?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Thanks! That's a bit more complicated and would involve some type of user authentication
@rvinothkmr
@rvinothkmr 2 жыл бұрын
Good beginners guide. Thanks. Can you show how to populate a drop-down selection with a database column contents.
@mensageir0_d0_futur0
@mensageir0_d0_futur0 Жыл бұрын
Do we need to have Elementor Pro to make this app CRUD on the page?
@InkaHacker
@InkaHacker Жыл бұрын
Hopefully he will answer. I'm basically looking for a solution like that too
@dean-orochester7374
@dean-orochester7374 2 жыл бұрын
Hi Tony Great tutorial... Question though. If I have a couple pages that do the Create step, how does the Add button know what function to call in my theme's functions.php file? Say I have a form to add people and I have a form to add teams. What ties the add_action( 'elementor_pro/forms/new_record', function( $record, $handler ) to which form?
@philippscholler487
@philippscholler487 2 жыл бұрын
Thx for the great tutorial!! One question: Is there a major advantage to insert the data like this compared to your other tutorial: "How to Save Elementor Form Data to Your Database"?? Thanks a lot! 🙂
@TonyTeachesTech
@TonyTeachesTech 2 жыл бұрын
If you need to update and/or delete data, then this method would be a better choice for you
@philippscholler487
@philippscholler487 2 жыл бұрын
@@TonyTeachesTech Thank you soo much for the answer! I only thing is that I'm not able to get it working on my siteground page. Even the support wasn't finding a solution 🙈
@adamford4dwebdesign
@adamford4dwebdesign 7 ай бұрын
Hi Tony I am having a lot of trouble getting the data to show up in my table. I am pretty sure something is wrong. I am using php my admin and have followed the steps I can only imagine I have got something wrong with the database name or something. Can you help?
@shelah.felias
@shelah.felias 3 жыл бұрын
Great video! Could you also show us how to do CRUD using the built in phpmyadmin database for Wordpress?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Very similar steps... only difference is that you would execute the MySQL commands within phpmyadmin
@GauravSrivastv
@GauravSrivastv 3 жыл бұрын
Very useful example. How can we search and display data based upon the user input?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
I will have to suggest that you research online for examples of how to do that
@penikmatvideo2
@penikmatvideo2 3 жыл бұрын
Hi Tony, this is good practice and real time but what i'm thingking right now is where is the wordpress function we need ? i mean if we doing this way, wordpress is just for create a form where is built using elementor so conclusion, we can create this tutorial without a wordpress instead simple form html and php. but once again your tutorial is great ...thanks
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Yes of course. I have a very similar tutorial without needing WordPress kzbin.info/www/bejne/aZrWlZZ3er-ip5I
@arniefraga
@arniefraga 3 жыл бұрын
Hi Tony! Is the Forms API available only to elementor pro? Cause in the function header it indicates "add_action( 'elementor_pro..." and when i change it to just 'elementor' it does not work. Is there any way I can use the Forms API without upgrading to pro?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
The Forms API is only available in Elementor Pro developers.elementor.com/elementor-pro-apis/
@billymartin6497
@billymartin6497 3 жыл бұрын
Love the video. Here is what I'm trying to do and maybe you could please either make a video or give me advice. I have an app that saves the user's data to a MySQL database via a rest endpoint. I would like for the user to be able to view the data on my WordPress site. I need the user to register and sign-in, then be directed to a page that shows the user's data. What is the best way with WordPress and Element or (both free versions)?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
That will require a good amount of custom written code (especially if you want to use it in production since we would be dealing with sign ups and authentication). I can consider making a tutorial in the future on this topic, but it won't be anytime soon.
@nrsingadasa7607
@nrsingadasa7607 3 жыл бұрын
Awesome thanks alot for this tutorial. How would we allow only that user to change their score and not others. How do we incorporate user privileges.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
That gets much more complicated than what we do in this video
@orlandorodriguez343
@orlandorodriguez343 2 жыл бұрын
thanks good video, if I need to do it on my own wordpress server? what do i replace this with? wp_remote_post
@nicholaskizito4438
@nicholaskizito4438 3 жыл бұрын
Hi thanks for the video. Do you have a video of Master details tables
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
No, I don't
@mauricemuteti4053
@mauricemuteti4053 2 жыл бұрын
Do you have this complete CRUD Project local host?
@mauricemuteti4053
@mauricemuteti4053 2 жыл бұрын
Or on github?
@edwintjoa6099
@edwintjoa6099 3 жыл бұрын
Thanks Tony for this great video!! I was trying out on a localhost installed on windows 10 but was stucked with linking the php files properly. Like "include '/var/www/db.php';", I changed it to "../db.php".
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
That will work just fine
@Filipesko123
@Filipesko123 3 жыл бұрын
Hello Tony, really neat stuff. I have a problem with the create.php file. When i click on the "Add" button it just doesn't trigger writing the data in the db. You have any advice how to debug the problem? The read.php is getting the db and writing the stuff down in the html shortcode (when i put data manually). Instead of "name" and "score" I'm trying to pass the value of a "select" form type and write it into a enum.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
This could be a syntax error. If you use Google Chrome, you can go to View > Developer > Developer Tools and at the bottom you'll see a Console window that will show errors. The shortcoming here is that this won't show errors in your PHP code. For that, copy and paste your create.php code here phpcodechecker.com/ to check it
@Filipesko123
@Filipesko123 3 жыл бұрын
@@TonyTeachesTech I've solved it by doing it again, this time excatly like yours and then i modified it to my needs so I guess it was a syntax error yes. Thanks so much. Now I'm trying to read that data somehow with a GET request. I'm doing it for a UNI project and Arduino should get the data from either the database or from the site directly. Tried a couple of things but not working ATM. If u have any solutions on the top of your head it would be helpful, but either way you already helped so much. Much love
@kily04
@kily04 2 жыл бұрын
Just asking cause i used your video to create a little website to manage an inventory and its working well, thanks But can we add a form to the read.php that will redirect to read.php so that we can search an element in all the records. Ex : I've 50 people with an id and if i enter the id 34 i'll have the information of only this person, or of I type teacher i'll have all the teacher of this list ... I've tried it in an external php file and its working but when i try to add it to the read.php the value entered is seen on the url bar but can't be isset or !empty Should I change the getReadUrl in the elementor editing ?
@claudiofuentes9880
@claudiofuentes9880 3 жыл бұрын
Would be perfect with edit option =) maybe user roles? user may add / admin may edit / and super admin may delete =) thanks for your tutorials
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Please see 28:43 for edit (I call it update in the video) When integrating user roles, it gets a bit more complicated. I'll leave that for another video :)
@marcoabate98
@marcoabate98 Жыл бұрын
I create the folder Api and the PHP file "create.php" but the server respond with 404 error and the message: {"success":true,"data":{"message":"","data":[]}}. Why?
@scabiegaming4686
@scabiegaming4686 3 жыл бұрын
I have question about the read or select data from database part of the video, What if those data will be displayed in a select box or a dropdown according to the current user. is it possible to implement with that kind of structure ?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Yeah sure. This is where json is helpful because you can pack your list data in a json object. Another option is to simply delimit your data with commas and then parse it
@johnpocock6018
@johnpocock6018 3 жыл бұрын
Hi again, if you wanted to validate a field say you had the form prompt for userid, where would you put the validation for valid userid? where is the best place for this type of validation? cheers John
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
You can do some basic JavaScript validation before the form is submitted on the client side (things like checking to see if the format looks okay, it's not too long, too short, etc) and then on the server side in PHP you can do the heavier input validation
@NakelJ
@NakelJ 3 жыл бұрын
Thank you so much Tony, My challenge here is using the already existing wordpress class 'global $wpdb;' to connect to my database instead of creating a db.php file. How do I go about that? THank you
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
You might be able to pull that off in your functions.php file in WordPress
@thinkastro8688
@thinkastro8688 3 жыл бұрын
What a great content! What if I would like to make a submit from using the database. For example, I build a 100 countries list with lat/long value in the database. While customer select the specific country name, the lat/long data will be sent to another app through the webhook function in Elementor. How to make it work?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Sounds like it's possible to do that. You'll have to do some research to make it work
@hookienumber1
@hookienumber1 7 ай бұрын
Seems great, I've tried the same on a hostinger server and the result was not as expected, I couldn't even create the record on the data base, I might be doing something wrong but not sure what it is, i've changed on db.php localhost for the ip and on creat.php I've put the domain with www. still no result. What should I keep in mind when changing from localhost to live server?
@belugabibletranslations8594
@belugabibletranslations8594 2 жыл бұрын
Can you please : 1. How do I allow user to change variable values ? 2. How do I perform calculations ?
@TonyTeachesTech
@TonyTeachesTech 2 жыл бұрын
Thank you for the suggestions
@aquilaack2221
@aquilaack2221 3 жыл бұрын
Hey! what happens to the id if you delete a row, does all the items in the database adjusts or is it just gone and the increment continues. and how does that affect the code when you get the id from the table with UPDATE and DELETE?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
The auto increment will continue. Since you are querying the existing rows only, there will be no difference in performance after deleting a row or rows
@datadrix
@datadrix 8 ай бұрын
not working for me could you helo me out ?
@hrishlu
@hrishlu 3 жыл бұрын
Hi Tony, the form data is not passed on to the database. i get message "Server error. Form not sent. Email Server error. Form not sent. This Message is not visible for site visitors." Need help"
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Are you online? Sounds like your having issues with the email not being sent AND the form data not being sent.
@davedunn6479
@davedunn6479 3 жыл бұрын
Hi Tony - great video. How would I create a form (or forms) that adds a record to a database in the context of a user and then allows an admin to perform CRUD operations on those records?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
This is a harder problem that involves authentication, usernames, passwords, etc. I don't have any tutorial on that
@aquilaack2221
@aquilaack2221 3 жыл бұрын
Hi again, I am using Hostinger as my hosting provider, I was wondering how do you create those .php files if the website is not hosted locally?
@aquilaack2221
@aquilaack2221 3 жыл бұрын
I'm sorry this is a stupid question, of course I can do that at my hosting provider's file manager.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
You can make these PHP files with an FTP file manager. Not sure if Hostinger has this built-in. If not, you can use a program like Cyberduck to connect to your website server
@aquilaack2221
@aquilaack2221 3 жыл бұрын
@@TonyTeachesTech noted. Thanks a lot!
@YasirAli-vh4zm
@YasirAli-vh4zm 3 жыл бұрын
Hey, great content but setting up ssh connections and MySQL connections for super nerds is a bit complex. What if the same tutorial with no terminal involved. lol . something based on PHPmyadmin.. and PHP snippets. Thanks.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
You can execute these same MySQL commands in phpmyadmin!
@kaarelvomm7716
@kaarelvomm7716 2 жыл бұрын
Javascript script will not show data from database. Looks like the read() function address is wrong. Had to change it from "api/read.php" to "wordpress/api/read.php"
@TonyTeachesTech
@TonyTeachesTech 2 жыл бұрын
👌
@jheimison007
@jheimison007 Жыл бұрын
pode me ajudar a fazer estas configurações com um site ja publicado na internet
@afrikanking4022
@afrikanking4022 2 жыл бұрын
why did u not just use wpdb global variable, i came here to learn that
@nuevoser2313
@nuevoser2313 3 жыл бұрын
How could I do the same but connecting to an external database (mysql)?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Instead of localhost, put the IP or domain name of the external database
@fvgoya
@fvgoya 3 жыл бұрын
I just don't understand why you put the db.php one level up. I mean, you are completely right to do that. But your wp-config.php still at the website root level. So, why move db.php to keep safe if the file that access the main db, still at the root level? Also, why create a new database if you could use the WordPress database that you already have and just create a new table? Sorry to make lot of questions. Thanks!
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
To your point, wp-config.php should also be outside of the website root as well. There are many different ways to accomplish the same thing, and in this case I chose to create a new database. Another option as you pointed out is to add a table to the existing WordPress database. Either method is fine :)
@fvgoya
@fvgoya 3 жыл бұрын
@@TonyTeachesTech i see. Thank you for answer!
@cbmortimer
@cbmortimer 10 ай бұрын
It's Jan 2024 and it looks like this CRUD doesn't work anymore. Maybe the latest version of elementor has broken something but from 19 minutes onwards it doesn't work now. Pity.
@pawanmaurya7146
@pawanmaurya7146 3 жыл бұрын
Can we Install wordpress with MongoDB ? if yes, How?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
I'm not sure, I have never done that before
@pawanmaurya7146
@pawanmaurya7146 3 жыл бұрын
will this work with MongoDB also??
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Yes probably with a slightly different implementation
@pawanmaurya7146
@pawanmaurya7146 3 жыл бұрын
@@TonyTeachesTech Can you Connect with me and help me with this. I working on a project and stuck for a long time around 2 weeks... Please help me Brother.
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
@@pawanmaurya7146 Sorry, I am not taking on any new clients at this time. If there is a specific question, I can do my best to point you in the right direction though
@andimom2010
@andimom2010 3 жыл бұрын
Ty
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
You're welcome Andrea
@helpmeoh4249
@helpmeoh4249 3 жыл бұрын
Hey brother, thanks for the video, but I'm having issue inserting the data into the database. I am using a localhost on my machine (localhost:8080), I'm not sure if I need to add the :8080 or just the localhost. My database is on my root directory of my WordPress, it name (db.php). I can seem to connect things together please help me. I need help connecting the wp_remote_post, the database and the create.
@klikdadang
@klikdadang Жыл бұрын
looks so simple until i tried 😁
@abbas5324
@abbas5324 3 жыл бұрын
Why you don't make database using php my admin?
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
I did not have phpmyadmin installed in this case, but that is an option
@dpmptspkalteng6936
@dpmptspkalteng6936 2 жыл бұрын
how to make table data lookup with elementor
@aquilaack2221
@aquilaack2221 3 жыл бұрын
heyyyyyy
@TonyTeachesTech
@TonyTeachesTech 3 жыл бұрын
Hey!
@jheimison007
@jheimison007 Жыл бұрын
Boa tarde alguém pode me ajudar?
@kc5cmx
@kc5cmx 2 жыл бұрын
There are 1,000 ways to build a lightbulb but only one that works. This is way too complicated for what I want. I want a simple and easy plugin that will allow me to do all the CRUD stuff without having to manually create the DB and SQL files. If I had the access to the server-side (which I do), the last thing I want to do is get in there and screw around with a database for practice or anything else. Elementor is NOT my choice to do anything with. There must be another way!
@TonyTeachesTech
@TonyTeachesTech 2 жыл бұрын
Not that I'm aware of at this point at least
@rajonlyraj7014
@rajonlyraj7014 2 жыл бұрын
@@TonyTeachesTech Sir, will these same methods be used for plugin crud operation?
Really Simple CRUD Operations Tutorial with PHP and MySQL
28:37
Tony Teaches Tech
Рет қаралды 32 М.
How to Save Elementor Form Data to Your Database
12:45
Tony Teaches Tech
Рет қаралды 89 М.
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 34 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 97 МЛН
The Singing Challenge #joker #Harriet Quinn
00:35
佐助与鸣人
Рет қаралды 35 МЛН
Simple WordPress Plugin Development - Start to Finish
2:29:29
Mr Digital
Рет қаралды 69 М.
Create a directory using Elementor, ACF & CPT UI
32:02
Elementor
Рет қаралды 110 М.
How to Use Elementor Forms API and Access Form Data in PHP
22:43
Tony Teaches Tech
Рет қаралды 40 М.
The Basics of Dynamic Content in 15 Minutes
18:16
Rino de Boer
Рет қаралды 186 М.
PHP Basics for WordPress - A Beginners Guide to WordPress PHP
1:16:15
Machine Learning for Everybody - Full Course
3:53:53
freeCodeCamp.org
Рет қаралды 7 МЛН
Python Django Web Framework - Full Course for Beginners
3:45:41
freeCodeCamp.org
Рет қаралды 4,6 МЛН
How to Do Database Stuff with Django Models (without knowing SQL)
13:48
Tony Teaches Tech
Рет қаралды 3,3 М.
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 34 МЛН