57: How to create a search field with PHP and MySQLi | PHP tutorial | Learn PHP programming

  Рет қаралды 256,980

Dani Krossing

Dani Krossing

Күн бұрын

How to create a search field with PHP and MySQLi - Learn PHP backend programming. In this video we will learn how to create a search feature using PHP from scratch.
➤ GET ACCESS TO MY LESSON MATERIAL HERE!
First of all, thank you for all the support you have given me!
I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
I hope you will find it helpful :)
Material for this lesson: / lesson-material-42361704

Пікірлер: 362
@natiqmumtaz5309
@natiqmumtaz5309 4 жыл бұрын
"Search" code starts at 28:53
@xiaoyang4521
@xiaoyang4521 5 жыл бұрын
This session really wowed me. As a total programming dummy, I didn't know you can build a search function by watching just 46 mins of video. Thank you Daniel!!
@CaptainAwesomeVlog
@CaptainAwesomeVlog 3 жыл бұрын
Perhaps the best thing about your tutorials is that they provide a basis from which I am able to extend and adapt the content to my needs quite easily. Today I finished my search tool based on your tutorial, for my multi-user image gallery. Works perfectly.
@akashdhanorkar5826
@akashdhanorkar5826 7 жыл бұрын
It makes easy to learn when you explain everything properly. It helped me a lot. Thank you for the videos
@atik8262
@atik8262 3 жыл бұрын
#2020 I wrote the exact same script and found one problem which is, when you hit submit without typing anything into the input field, it shows all the records from your database table. I was about to ask Daniel for a solution but then I thought, wait a minute! it's easy :-) So in case anyone face the same problem and need a solution, just do this.. after getting user input, run an if statement like, if ( $input != null ) { rest of the code; } else if ( $input == null ) { error message; } And thank you so much Daniel
@ryandewilde6396
@ryandewilde6396 3 жыл бұрын
You could also put a required in at the input. So you can only hit the button if there is a value in it. And thus you don't go to an empty page with only an error message. This is atleast what I did :P
@atik8262
@atik8262 3 жыл бұрын
@@ryandewilde6396 yeap, i didn't know about "required " attribute then 😅
@garfielf6301
@garfielf6301 3 жыл бұрын
@@ryandewilde6396 Problem with that is if someone still really wanted to see all the records, they could just inspect element and remove the required attribute manually or just type in a space and all the results that include a space will appear
@arjuntantry7894
@arjuntantry7894 2 жыл бұрын
ahh just what i wanted finally!! i actually recommend watching all earlier 56 videos and then come back here because you probably wont completely understand whats going on here ill tell ya something these tutorials are such a confidence booster to me .Thanks Daniel!
@jarrodestepp2070
@jarrodestepp2070 7 жыл бұрын
I myself just want to thank you personally for making these tutorials. Yours always help me better then any else.
@Paulprokhoury
@Paulprokhoury 3 жыл бұрын
please can u send me the codes please
@elel928
@elel928 4 жыл бұрын
Fantastic lesson. This will keep me busy coding my own website for the next week. So many questions I had have been answered in this video. Huge thanks.
@marlonmartins1538
@marlonmartins1538 2 жыл бұрын
This lesson was so useful for me to work on my page integrating PHP and SQL queries with container results div. Thank you so much! Greetings from Brazil.
@akachi1637
@akachi1637 3 жыл бұрын
I always come to this guys videos and i am always 100% satisfied. this guy is a legend. I am subbing
@Paulprokhoury
@Paulprokhoury 3 жыл бұрын
please i want the code for my university it dont print any thing when search
@nathanhamlett8133
@nathanhamlett8133 5 жыл бұрын
Absolutely love your tutorials man keep posting you create a lot of value for the programming community!
@WvyyFPS
@WvyyFPS 3 жыл бұрын
Thank you so much for this tutorial. This helped me so much while taking development courses during the pandemic. Wouldn't have been able to have learned this without you!
@creativesasi2691
@creativesasi2691 4 жыл бұрын
You are the best. All the things are very clear. Thank you So much Mr. Danniel...
@benimdraws
@benimdraws 4 жыл бұрын
Dude... I'm here in 2020 and your tutorials are just the best, no doubt about it. You explain everything so good and I have NEVER failed with something when watching your tutorials. Are you a magician or something? haha :D
@sabinedewin892
@sabinedewin892 5 жыл бұрын
Thank you so much for your video tuts, they helped me a LOT during my traineeship. Keep up the good work, looking forward to more tutorials!
@CalvinBonner
@CalvinBonner 3 жыл бұрын
I know this video was posted years ago, but thank you! This was super informative as always. I don't know if you ever plan to post an updated video but, if you do, I would love to see how this search function could work with full pages on the site (so instead of putting all the data in the database itself, you can search through all pages on the website). Anway, thanks again!
@turdferguson195
@turdferguson195 6 жыл бұрын
Your lessons explain everything so well! Thank you so much!
@junlinhe9049
@junlinhe9049 6 жыл бұрын
Thank you so much for your unselfish sharing! I really appreciate it. Keep going. You did a really good job!
@amelialim5364
@amelialim5364 3 жыл бұрын
Thank you so much for this, sir! I've been really stressed out since I'm still a beginner to php but this video and your clear explanation really helped me a ton! I really appreciate this. Liked and subscribed so that it can reach a wider audience. Hope you're having a great day. :)
@thatsnocopyright6133
@thatsnocopyright6133 6 жыл бұрын
Thank you! Good explaining and I like that you explain what everything is and does! Subscribed and Followed!
@nmrisrl11
@nmrisrl11 6 жыл бұрын
Thanks you for all your PHP tutorials mmtuts :) just downloaded the full part of PHP tuts.
@sneharoshanprasad7484
@sneharoshanprasad7484 4 жыл бұрын
Omg! This is one of the best videos I have ever seen😍!!! The way you have explained the concepts is really awesome👍 Keep making such video.❤️from🇮🇳
@shripradamahajan8054
@shripradamahajan8054 7 жыл бұрын
i have learned a lot from your tutorials, very well explained, thank you!!
@TheSakyun
@TheSakyun 6 жыл бұрын
Great video, i did this followed the tutorial but did everything using PDO instead, still worth the watch
@sharifabahar6257
@sharifabahar6257 6 жыл бұрын
Best , clear , simple , Thank you Danial it was really useful , Thank you for your time and efforts .
@theunboxingchannel3735
@theunboxingchannel3735 6 жыл бұрын
Your videos really help. You explain every method and concept very thoroughly. i learned a lot from your videos. Thanks.
@ahmerjaved7627
@ahmerjaved7627 5 жыл бұрын
One of the best tutorial i've ever listened.....
@turdferguson195
@turdferguson195 6 жыл бұрын
Your tutorials are amazing! Thank you so much for the knowledge!
@nhlakaniphondwandwe796
@nhlakaniphondwandwe796 4 жыл бұрын
THANK YOU KIND SIR, YOUR TUTORIALS DO THE MOST. SHOUT OUT ALL THE WAY FROM SOUTH AFRICA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@30Quers
@30Quers 6 жыл бұрын
You explained it very clearly. Thumbs up!
@Quatsch82
@Quatsch82 6 жыл бұрын
Wow, you just created a mini CMS here. Really liked it, thanks!
@castlej8488
@castlej8488 3 жыл бұрын
omy you actually helped me on my project! thank you so much you earned a new sub! keep up the great work my man!
@MetaAndrej
@MetaAndrej Жыл бұрын
This is amazing. Thank you so much. This helped me in my MBA course
@Princejay-xu7ed
@Princejay-xu7ed 5 жыл бұрын
Hi sir thank you for creating this kind of tutorial this program help me a lot for my thesis :)
@w4rri0r0906
@w4rri0r0906 7 жыл бұрын
Thank you man, it is very helpful! Keep up the good work. :)
@joelcortez3527
@joelcortez3527 11 ай бұрын
Thank you very much for this video, it is very easy to understand.
@hailebraile
@hailebraile 5 жыл бұрын
thank you so so so much! it helped me a lot for my exam next week
@cosmosandchill
@cosmosandchill 3 жыл бұрын
Thanks for this tutorial: you are a really good teacher!
@ColibriTrips
@ColibriTrips 3 жыл бұрын
Thank you for sharing your knowledge. Nice job!
@bodatawwab6558
@bodatawwab6558 Жыл бұрын
Your Tutorial is very useful, please keep going 🙏🙏
@MohPhpMaster
@MohPhpMaster 7 жыл бұрын
you know i'm professional PHP Programmer .. and i really enjoy with ur video . respect ..♥
@p1antings33ds8
@p1antings33ds8 6 жыл бұрын
@Pak Home Well, in my case it took years. And I'm still learning. The more you look at code and play with it the more you begin to understand it. It's kind of like learning another language, like Spanish.
@Cimex090
@Cimex090 5 жыл бұрын
Do you use PDO or mysqli ?
@mascotacademy2100
@mascotacademy2100 6 жыл бұрын
Great points you expressed here. Thanks.
@Mr_Mellowz
@Mr_Mellowz 3 жыл бұрын
Super helpful, Thank so much!
@TiffanyNg100
@TiffanyNg100 2 жыл бұрын
Love the details video! So clear for new bie like me to understand
@jamesframe2705
@jamesframe2705 6 жыл бұрын
This was a massive help. Thank you
@s.sedighi
@s.sedighi Жыл бұрын
Thanks Dani, that was very helpful 😍
@olaiyahabeeb
@olaiyahabeeb 6 жыл бұрын
Hi Daniel! All your tutorials are so so amazing, thanks for sharing your knowledge.
@sumeyradavran4738
@sumeyradavran4738 6 жыл бұрын
Daniel, you did the best php tutorial in the web. ı feel like I spent quality time in your lessons. I have learned great things thanks to you! I cannot thank you enough. I have a request from you though :) could you make a tutorial about star rating system in php? Maybe you can include a system where users can add content to favorites etc. I am curious about how to create many-to-many relationship in mysql and most of all how to implement this in php? Rating system or add to favorites seems perfect to learn. Again, thanks for your great efforts.
@DetectiveMichealScarn
@DetectiveMichealScarn 7 жыл бұрын
Been waiting for this! Love it
@quakepie6627
@quakepie6627 5 жыл бұрын
thank you this what i need. hope you make a advance search field.
@ariftahir3092
@ariftahir3092 6 жыл бұрын
Thank you very much, very helpful.
@MilanB
@MilanB 7 жыл бұрын
You Nailed it! Just what I needed. :)
@savidulai
@savidulai 5 жыл бұрын
Says Quagmire haha
@Paulprokhoury
@Paulprokhoury 3 жыл бұрын
please can u send me the code
@AdelinBonheur
@AdelinBonheur 4 жыл бұрын
Thank you bro you're the best GEEK, I had a problem of search bar which was missing on my site and now you saved my a**!! Thank you so so much. If possible you would make for me two videos one showing how to add a download button with an embedded link from the database and another one showing how to make an auto_complete search-bar.
@user-cc9gq6de2t
@user-cc9gq6de2t 7 жыл бұрын
Thanks so much, Daniel! You rock
@sagarmaheshwary3150
@sagarmaheshwary3150 6 жыл бұрын
Thank You for your hard work.
@chaddsmith3354
@chaddsmith3354 2 жыл бұрын
Thank you for the video!
@essentialjazztranscriptions
@essentialjazztranscriptions 3 жыл бұрын
Simply a legend, and danish at it at well. Musician at the conservatory trying to get a sidegig. I've followed a lot of your great tutorials, and are very close to finishing my website. I was wondering what you've studied at the university, and do you know if you need an education to become a web developer, (or software-engineer in general), or can you get a job with the skills you provide tutorials for? I'm very curious! A video about it would be nice, but a comment will also do - I'll take what I can get ;)!
@germanduterte7110
@germanduterte7110 3 жыл бұрын
from mmtuts to Dani Krossing I love all of ur tutorial, It's really a big help to people like me who can't afford paying for proper education. very poor guy.
@loaf7832
@loaf7832 6 жыл бұрын
THANK YOU MAN YOU'RE THE BEST
@onur8727
@onur8727 3 жыл бұрын
dude you are amazing! thank you.
@dhakprasadupreti6249
@dhakprasadupreti6249 4 жыл бұрын
Thank your very much for your good job.
@kristijan7140
@kristijan7140 7 жыл бұрын
It's very helpful video :D Thanks!!
@liet365
@liet365 5 жыл бұрын
Great video, thank you!
@SubhanHamid
@SubhanHamid 6 жыл бұрын
thank you very much. The way you teach us is very clear, so we easy to understand the tuts. Question: do we really need always to include $conn variable before $_POST['search'] ? What I know is that mysqli_query function always need two arguments and one of them is $conn and the query statement.
@BdEnglishTutorial
@BdEnglishTutorial 3 жыл бұрын
very effective php ...!!! Really it is true. If, I could Subscribe to this Channel 100000+ times, I would do ...!!!!!
@StockFanatic
@StockFanatic 6 жыл бұрын
Thank you, appreciated!
@glenn9490
@glenn9490 5 жыл бұрын
i am new in webdeveloping and this video is sooooooo helpful. Can i give more than one thumbsup? Anyways, thanks for sharing this. kudos
@brebz7
@brebz7 6 жыл бұрын
Hello ! Is there a reason why at min 33:59 when you add the $search inside the string you don't wrap it around two dots ? Like you do at 39:29 ? Also great work with the tutorials ! They are amazing !
@jlayinronchi5888
@jlayinronchi5888 6 жыл бұрын
Thnx man for helpful tutorial ♥️🙏
@SANBIRTRADING
@SANBIRTRADING 2 жыл бұрын
Great Tutorial! Please make a tutorial for the directory listing website's multiple search box filtering.
@zareenremendies
@zareenremendies 3 жыл бұрын
It helped me a lot.
@ferminduron5089
@ferminduron5089 6 жыл бұрын
Awesome video, thanks
@tonismith1445
@tonismith1445 4 жыл бұрын
Very Nice Tutorial! Super easy to follow thank you! Can you make a video how to search every table in a database? Like for example you have 5 tables (cars, users, maintenance, contact, price). Because I been trying to refactor your example code but it's fighting me and being a beginner I don't know enough about PHP to figure why I can't get it to work.
@bharath2477
@bharath2477 7 жыл бұрын
In most cases, ID is used to refer to the article. Using title and date of article seems to be pointless. Anyway, the tutorial is nice!
@sajid3160
@sajid3160 4 жыл бұрын
best tutorial THanks
@MrFrezix
@MrFrezix 3 жыл бұрын
Thank you very much!
@yaokouassijean-claude1499
@yaokouassijean-claude1499 7 жыл бұрын
Thanks you! very very much..it's a great tutorials,. All tutorials Excellents..
@Dani_Krossing
@Dani_Krossing 7 жыл бұрын
Thank you :)
@tojiyev_cg
@tojiyev_cg 7 жыл бұрын
Thanks for helpful video
@ryansgnx
@ryansgnx 6 жыл бұрын
Wow this worked great!. Just curious as to know how you can cover the articles displayed page and only be able to view them once you've typed in the title on the search bar
@parasmanikc7341
@parasmanikc7341 6 жыл бұрын
great one brother
@birdofhermes6152
@birdofhermes6152 4 жыл бұрын
Thanks a lot for this
@lauracooper4676
@lauracooper4676 3 жыл бұрын
THANK YOU!
@Paulprokhoury
@Paulprokhoury 3 жыл бұрын
please can u send me the code when i search it dont print any thing
@yoitslemonboy6988
@yoitslemonboy6988 5 жыл бұрын
this is a great tutorial a suggestion though you should add comments to your code that way we always have a reference to what is what
@JaoMAS
@JaoMAS 4 жыл бұрын
Awesome, thanks!
@tinsalada
@tinsalada 4 жыл бұрын
Thank you VERY VERY VERY VERY much
@garfielf6301
@garfielf6301 3 жыл бұрын
39:21 I think line 15 echo "There are ".$queryResult." results! "; should be below the if ($queryResult > 0) statement instead, because if you get 0 results the page will say both "There are 0 results" and "There are no results matching your search", which is a bit redundant. Thanks for video
@photoinshot1355
@photoinshot1355 3 жыл бұрын
Great tutorial thanks! I would be interested to know with regards to the comments from Junior WebDeveloper below, which of the two solutions to the empty search box situation is the "correct way"?
@WasikaHausaNews
@WasikaHausaNews 11 ай бұрын
Nice thank you so much
@bravehotsauce
@bravehotsauce Жыл бұрын
Thank you!
@SimkePA
@SimkePA 5 жыл бұрын
Daniel, thanks a lot for all fantastic videos! I guess you have a lot of things to do already, but you should be a tutor on some university! Your codes and speech are very clear and easy to understand! Bravo!
@vijayakumar_3
@vijayakumar_3 4 жыл бұрын
Thamk you so Much Brother..:) 🧡🧡🧡
@katrinafatah
@katrinafatah 6 жыл бұрын
Thank you so much!
@mikev2066
@mikev2066 4 жыл бұрын
Daniel, I have a stupid question. Can I save in Article's text (a_text) html tags? For a better formatting on view page. Like , , .....Is that okay and safe?
@UTprema
@UTprema 7 жыл бұрын
Thanks, good one
@christoferi9636
@christoferi9636 6 жыл бұрын
understandable!!! illustrative!!! keep going!!! Make a video about how to make a brand filter for online shop
@rezwanulislam4264
@rezwanulislam4264 5 жыл бұрын
THANK YOU VERY VERY MUCH!!!!!!!!!!
@yongjung5433
@yongjung5433 5 жыл бұрын
Thank you so much!!
@rivindhugeeneth9987
@rivindhugeeneth9987 4 жыл бұрын
Thank You! Sir.
@saidsharif6549
@saidsharif6549 3 жыл бұрын
Thank you so much for your amazing explanation, this video has been really helpful to me. But I got one problem I don't know how to deal with it. I have two tables in my database, how to access both of them from my search field?
@vitocraftlp
@vitocraftlp 3 жыл бұрын
3:14, this put a smile to my face
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 32 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 35 МЛН
#12. Search Data using PHP and MySQL database.
34:09
Step by Step
Рет қаралды 86 М.
Ajax Live Data Search with jQuery PHP MySQL
10:20
WebsiteGeek
Рет қаралды 89 М.
Creating a simple pagination using php and mysql
15:57
Digital Fox
Рет қаралды 20 М.
Redis Crash Course
27:31
Web Dev Simplified
Рет қаралды 592 М.